diff options
author | Keith Wood <kbwood.au@gmail.com> | 2009-11-29 22:56:30 +0000 |
---|---|---|
committer | Keith Wood <kbwood.au@gmail.com> | 2009-11-29 22:56:30 +0000 |
commit | 378260f132253fa76a3634311a23bf154808d9a7 (patch) | |
tree | ba900869e9e4445133667f073c341c3b1d1a5da1 | |
parent | 2b12ea0308ff4c8ed563eb51f43991df2d49588b (diff) | |
download | jquery-ui-378260f132253fa76a3634311a23bf154808d9a7.tar.gz jquery-ui-378260f132253fa76a3634311a23bf154808d9a7.zip |
Datepicker - Fixed #4787 - Datepicker: fix animation control
-rw-r--r-- | ui/jquery.ui.datepicker.js | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js index db076090c..181af6ab0 100644 --- a/ui/jquery.ui.datepicker.js +++ b/ui/jquery.ui.datepicker.js @@ -607,7 +607,7 @@ $.extend(Datepicker.prototype, { 'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none', left: offset.left + 'px', top: offset.top + 'px'}); if (!inst.inline) { - var showAnim = $.datepicker._get(inst, 'showAnim') || 'show'; + var showAnim = $.datepicker._get(inst, 'showAnim'); var duration = $.datepicker._get(inst, 'duration'); var postProcess = function() { $.datepicker._datepickerShowing = true; @@ -619,8 +619,8 @@ $.extend(Datepicker.prototype, { if ($.effects && $.effects[showAnim]) inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); else - inst.dpDiv[showAnim](duration, postProcess); - if (duration == '') + inst.dpDiv[showAnim || 'show']((showAnim ? duration : ''), postProcess); + if (!showAnim) postProcess(); if (inst.input[0].type != 'hidden') inst.input[0].focus(); @@ -720,19 +720,18 @@ $.extend(Datepicker.prototype, { if (!inst || (input && inst != $.data(input, PROP_NAME))) return; if (this._datepickerShowing) { - duration = (duration != null ? duration : this._get(inst, 'duration')); + duration = duration || this._get(inst, 'duration'); var showAnim = this._get(inst, 'showAnim'); var postProcess = function() { $.datepicker._tidyDialog(inst); }; - if (duration != '' && $.effects && $.effects[showAnim]) - inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'), - duration, postProcess); + if ($.effects && $.effects[showAnim]) + inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); else - inst.dpDiv[(duration == '' ? 'hide' : (showAnim == 'slideDown' ? 'slideUp' : - (showAnim == 'fadeIn' ? 'fadeOut' : 'hide')))](duration, postProcess); - if (duration == '') - this._tidyDialog(inst); + inst.dpDiv[(showAnim == 'slideDown' ? 'slideUp' : + (showAnim == 'fadeIn' ? 'fadeOut' : 'hide'))]((showAnim ? duration : ''), postProcess); + if (!showAnim) + postProcess(); var onClose = this._get(inst, 'onClose'); if (onClose) onClose.apply((inst.input ? inst.input[0] : null), |