aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorKato Kazuyoshi <kato.kazuyoshi@gmail.com>2011-05-07 05:58:06 +0900
committerKato Kazuyoshi <kato.kazuyoshi@gmail.com>2011-05-07 06:03:14 +0900
commit2063a113d6dbae006413896a93d46a34ebc9b155 (patch)
tree7f11fa0bf7703a973f051699b66f43e6d5137c59 /ui
parent476777f1e926d56547291abda642683513f92610 (diff)
downloadjquery-ui-2063a113d6dbae006413896a93d46a34ebc9b155.tar.gz
jquery-ui-2063a113d6dbae006413896a93d46a34ebc9b155.zip
Datepicker: onClose callback should be triggered by show. Fixed #6656 - onClose event not triggered.
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.datepicker.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js
index 12323672a..7861cd5a9 100644
--- a/ui/jquery.ui.datepicker.js
+++ b/ui/jquery.ui.datepicker.js
@@ -609,6 +609,9 @@ $.extend(Datepicker.prototype, {
return;
var inst = $.datepicker._getInst(input);
if ($.datepicker._curInst && $.datepicker._curInst != inst) {
+ if ( $.datepicker._datepickerShowing ) {
+ $.datepicker._triggerOnClose($.datepicker._curInst);
+ }
$.datepicker._curInst.dpDiv.stop(true, true);
}
var beforeShow = $.datepicker._get(inst, 'beforeShow');
@@ -754,6 +757,14 @@ $.extend(Datepicker.prototype, {
return [position.left, position.top];
},
+ /* Trigger custom callback of onClose. */
+ _triggerOnClose: function(inst) {
+ var onClose = this._get(inst, 'onClose');
+ if (onClose)
+ onClose.apply((inst.input ? inst.input[0] : null),
+ [(inst.input ? inst.input.val() : ''), inst]);
+ },
+
/* Hide the date picker from view.
@param input element - the input field attached to the date picker */
_hideDatepicker: function(input) {
@@ -776,10 +787,7 @@ $.extend(Datepicker.prototype, {
(showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))]((showAnim ? duration : null), postProcess);
if (!showAnim)
postProcess();
- var onClose = this._get(inst, 'onClose');
- if (onClose)
- onClose.apply((inst.input ? inst.input[0] : null),
- [(inst.input ? inst.input.val() : ''), inst]); // trigger custom callback
+ $.datepicker._triggerOnClose(inst);
this._datepickerShowing = false;
this._lastInput = null;
if (this._inDialog) {