aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.datepicker.js
diff options
context:
space:
mode:
authorKeith Wood <kbwood.au@gmail.com>2010-02-06 23:07:00 +0000
committerKeith Wood <kbwood.au@gmail.com>2010-02-06 23:07:00 +0000
commitc16ed70b68298f83ae9107aad2f07461132d2aad (patch)
tree6a07f014a8bb077ef5db6d6481990159560c8f08 /ui/jquery.ui.datepicker.js
parent341dbce9e4aa3d4037f246ad292f5a5591ace2d8 (diff)
downloadjquery-ui-c16ed70b68298f83ae9107aad2f07461132d2aad.tar.gz
jquery-ui-c16ed70b68298f83ae9107aad2f07461132d2aad.zip
Datepicker: Fixed #5128 Datepicker opens when setDate called
Diffstat (limited to 'ui/jquery.ui.datepicker.js')
-rw-r--r--ui/jquery.ui.datepicker.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js
index cf2f6e127..3c0b799a8 100644
--- a/ui/jquery.ui.datepicker.js
+++ b/ui/jquery.ui.datepicker.js
@@ -649,7 +649,7 @@ $.extend(Datepicker.prototype, {
if (!showAnim)
postProcess();
if (inst.input.is(':visible') && !inst.input.is(':disabled'))
- inst.input[0].focus();
+ inst.input.focus();
$.datepicker._curInst = inst;
}
},
@@ -692,9 +692,9 @@ $.extend(Datepicker.prototype, {
'Class']('ui-datepicker-multi');
inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') +
'Class']('ui-datepicker-rtl');
- if (inst == $.datepicker._curInst && inst.input &&
+ if (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input &&
inst.input.is(':visible') && !inst.input.is(':disabled'))
- $(inst.input[0]).focus();
+ inst.input.focus();
},
/* Retrieve the size of left and top borders for an element.
@@ -845,7 +845,7 @@ $.extend(Datepicker.prototype, {
var target = $(id);
var inst = this._getInst(target[0]);
if (inst.input && inst._selectingMonthYear && !$.browser.msie)
- inst.input[0].focus();
+ inst.input.focus();
inst._selectingMonthYear = !inst._selectingMonthYear;
},
@@ -889,7 +889,7 @@ $.extend(Datepicker.prototype, {
this._hideDatepicker();
this._lastInput = inst.input[0];
if (typeof(inst.input[0]) != 'object')
- inst.input[0].focus(); // restore focus
+ inst.input.focus(); // restore focus
this._lastInput = null;
}
},