diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2011-05-18 15:51:07 +0200 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2011-05-18 15:51:07 +0200 |
commit | bdd2362754705628c7d5ad9a1b2edc8269c05e6c (patch) | |
tree | 692437cc3f129cd30797f93df520cb713cfb4909 /ui/jquery.ui.datepicker.js | |
parent | fef60bd6cb4352d0106ae00753458112f1ab3b78 (diff) | |
parent | 2063a113d6dbae006413896a93d46a34ebc9b155 (diff) | |
download | jquery-ui-bdd2362754705628c7d5ad9a1b2edc8269c05e6c.tar.gz jquery-ui-bdd2362754705628c7d5ad9a1b2edc8269c05e6c.zip |
Merge remote branch 'kzys/trac-6656'
Diffstat (limited to 'ui/jquery.ui.datepicker.js')
-rw-r--r-- | ui/jquery.ui.datepicker.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js index 519d4dfdb..021041202 100644 --- a/ui/jquery.ui.datepicker.js +++ b/ui/jquery.ui.datepicker.js @@ -614,6 +614,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'); @@ -759,6 +762,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) { @@ -781,10 +792,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) { |