Skip to content

Commit

Permalink
some more fixes for 1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tipiirai committed May 11, 2010
1 parent ae12e0f commit 14ef49a
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 22 deletions.
4 changes: 1 addition & 3 deletions build.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@

# version number
tools = 1.2.0
jquery = 1.3.2
sizzle = 0.9.3
tools = 1.2.1
32 changes: 22 additions & 10 deletions src/dateinput/dateinput.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
}
input.addClass(css.input);

var fire = input.add(this);
var fire = input.add(self);

// construct layout
if (!root.length) {
Expand Down Expand Up @@ -270,10 +270,12 @@
currMonth = date.getMonth();
currDay = date.getDate();


// change
e = e || $.Event("api");
e.type = "change";
fire.trigger(e, [date]);

fire.trigger(e, [date]);
if (e.isDefaultPrevented()) { return; }

// formatting
Expand Down Expand Up @@ -346,7 +348,7 @@
// enter
if (key == 13) {
if (!$(e.target).is("select")) {
select($("." + css.focus).data("date"), conf, e);
$("." + css.focus).click();
}
}

Expand Down Expand Up @@ -558,8 +560,11 @@

// date picking
a.click(function(e) {
if (!$(this).hasClass(css.disabled)) {
select($(this).data("date"), conf, e);
var el = $(this);
if (!el.hasClass(css.disabled)) {
$("#" + css.current).removeAttr("id");
el.attr("id", css.current);
select(el.data("date"), conf, e);
}
return false;
});
Expand Down Expand Up @@ -607,15 +612,21 @@

hide: function(e) {

if (opened) {
root.hide();
$(document).unbind("click.d").unbind("keydown.d");
if (opened) {

// onHide
opened = false;
// onHide
e = e || $.Event();
e.type = "onHide";
fire.trigger(e);

$(document).unbind("click.d").unbind("keydown.d");

// cancelled ?
if (e.isDefaultPrevented()) { return; }

// do the hide
root.hide();
opened = false;
}

return self;
Expand Down Expand Up @@ -676,6 +687,7 @@
});

// initial value

if (parseDate(input.val())) {
select(value, conf);
}
Expand Down
15 changes: 8 additions & 7 deletions src/tooltip/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,16 @@
// tip not initialized yet
if (!tip) {

// find a "manual" tooltip
// autogenerated tooltip
if (title) {
tip = $(conf.layout).addClass(conf.tipClass).appendTo(document.body).hide();
tip = $(conf.layout).addClass(conf.tipClass).appendTo(document.body)
.hide().append(title);

// single tip element for all
} else if (conf.tip) {
tip = $(conf.tip).eq(0);

// manual tooltip
} else {
tip = trigger.next();
if (!tip.length) { tip = trigger.parent().next(); }
Expand All @@ -185,14 +189,11 @@
if (self.isShown()) { return self; }

// stop previous animation
tip.stop(true, true);

tip.stop(true, true);

// get position
var pos = getPosition(trigger, tip, conf);

// title attribute
if (title) { tip.html(title); }


// onBeforeShow
e = e || $.Event();
Expand Down
6 changes: 4 additions & 2 deletions src/validator/validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@

/******* built-in HTML5 standard validators *********/

v.fn(":email", "Plase enter a valid email address", function(el, v) {
v.fn(":email", "Please enter a valid email address", function(el, v) {
return !v || emailRe.test(v);
});

Expand Down Expand Up @@ -467,7 +467,9 @@
// disable browser's default validation mechanism
if (inputs.get(0).validity) {
inputs.each(function() {
this.oninvalid = function() { return false; }
this.oninvalid = function() {
return false;
};
});
}

Expand Down

0 comments on commit 14ef49a

Please sign in to comment.