Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions jquery.timePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
if ($tpDiv.is(":visible")) {
return false;
}
settings.onBeforeShow() || $.noop();
$("li", $tpDiv).removeClass(selectedClass);

// Position
Expand Down Expand Up @@ -120,7 +121,7 @@
// Hide timepicker on blur
$(elm).blur(function() {
if (!tpOver) {
$tpDiv.hide();
$.timePicker(this).hidePicker();
}
});
// Keypress doesn't repeat on Safari for non-text keys.
Expand Down Expand Up @@ -182,7 +183,7 @@
return false;
break;
case 27: // Esc
$tpDiv.hide();
hidePicker();
return false;
break;
}
Expand All @@ -203,6 +204,12 @@
// Trigger element's change events.
$(elm).change();
};

this.hidePicker = function() {
// Hide picker
settings.onBeforeHide() || $.noop();
$tpDiv.hide();
}

}; // End fn;

Expand All @@ -226,8 +233,7 @@
if (!$.browser.msie) {
elm.focus();
}
// Hide picker
$tpDiv.hide();
$.timePicker(elm).hidePicker();
}

function formatTime(time, settings) {
Expand Down Expand Up @@ -274,4 +280,4 @@
return time;
}

})(jQuery);
})(jQuery);