Datepicker: added check to account for multiple pickers on one page. Fixed #5818 – multiple DatePickers won't trigger close event

This commit is contained in:
ryanolton 2012-01-12 11:22:48 -05:00
parent e2d9b02c56
commit 82cf9e297f

View File

@ -233,7 +233,10 @@ $.extend(Datepicker.prototype, {
inst.trigger.click(function() { inst.trigger.click(function() {
if ($.datepicker._datepickerShowing && $.datepicker._lastInput == input[0]) if ($.datepicker._datepickerShowing && $.datepicker._lastInput == input[0])
$.datepicker._hideDatepicker(); $.datepicker._hideDatepicker();
else else if ($.datepicker._datepickerShowing && $.datepicker._lastInput != input[0]) {
$.datepicker._hideDatepicker();
$.datepicker._showDatepicker(input[0]);
} else
$.datepicker._showDatepicker(input[0]); $.datepicker._showDatepicker(input[0]);
return false; return false;
}); });