diff options
Diffstat (limited to '')
-rw-r--r-- | themes/default/js/ui/jquery.ui.datepicker.js | 50 |
1 files changed, 19 insertions, 31 deletions
diff --git a/themes/default/js/ui/jquery.ui.datepicker.js b/themes/default/js/ui/jquery.ui.datepicker.js index e7c98c6ae..2e721f324 100644 --- a/themes/default/js/ui/jquery.ui.datepicker.js +++ b/themes/default/js/ui/jquery.ui.datepicker.js @@ -1,8 +1,8 @@ /*! - * jQuery UI Datepicker 1.10.1 + * jQuery UI Datepicker 1.10.4 * http://jqueryui.com * - * Copyright 2013 jQuery Foundation and other contributors + * Copyright 2014 jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * @@ -13,10 +13,9 @@ */ (function( $, undefined ) { -$.extend($.ui, { datepicker: { version: "1.10.1" } }); +$.extend($.ui, { datepicker: { version: "1.10.4" } }); var PROP_NAME = "datepicker", - dpuuid = new Date().getTime(), instActive; /* Date picker manager. @@ -753,9 +752,10 @@ $.extend(Datepicker.prototype, { inst.dpDiv[showAnim || "show"](showAnim ? duration : null); } - if (inst.input.is(":visible") && !inst.input.is(":disabled")) { + if ( $.datepicker._shouldFocusInput( inst ) ) { inst.input.focus(); } + $.datepicker._curInst = inst; } }, @@ -782,10 +782,7 @@ $.extend(Datepicker.prototype, { inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") + "Class"]("ui-datepicker-rtl"); - // #6694 - don't focus the input if it's already focused - // this breaks the change event in IE - if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input && - inst.input.is(":visible") && !inst.input.is(":disabled") && inst.input[0] !== document.activeElement) { + if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) { inst.input.focus(); } @@ -802,16 +799,11 @@ $.extend(Datepicker.prototype, { } }, - /* Retrieve the size of left and top borders for an element. - * @param elem (jQuery object) the element of interest - * @return (number[2]) the left and top borders - */ - _getBorders: function(elem) { - var convert = function(value) { - return {thin: 1, medium: 2, thick: 3}[value] || value; - }; - return [parseFloat(convert(elem.css("border-left-width"))), - parseFloat(convert(elem.css("border-top-width")))]; + // #6694 - don't focus the input if it's already focused + // this breaks the change event in IE + // Support: IE and jQuery <1.9 + _shouldFocusInput: function( inst ) { + return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" ); }, /* Check positioning to remain on screen. */ @@ -1558,27 +1550,27 @@ $.extend(Datepicker.prototype, { inst.dpDiv.find("[data-handler]").map(function () { var handler = { prev: function () { - window["DP_jQuery_" + dpuuid].datepicker._adjustDate(id, -stepMonths, "M"); + $.datepicker._adjustDate(id, -stepMonths, "M"); }, next: function () { - window["DP_jQuery_" + dpuuid].datepicker._adjustDate(id, +stepMonths, "M"); + $.datepicker._adjustDate(id, +stepMonths, "M"); }, hide: function () { - window["DP_jQuery_" + dpuuid].datepicker._hideDatepicker(); + $.datepicker._hideDatepicker(); }, today: function () { - window["DP_jQuery_" + dpuuid].datepicker._gotoToday(id); + $.datepicker._gotoToday(id); }, selectDay: function () { - window["DP_jQuery_" + dpuuid].datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this); + $.datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this); return false; }, selectMonth: function () { - window["DP_jQuery_" + dpuuid].datepicker._selectMonthYear(id, this, "M"); + $.datepicker._selectMonthYear(id, this, "M"); return false; }, selectYear: function () { - window["DP_jQuery_" + dpuuid].datepicker._selectMonthYear(id, this, "Y"); + $.datepicker._selectMonthYear(id, this, "Y"); return false; } }; @@ -2041,10 +2033,6 @@ $.fn.datepicker = function(options){ $.datepicker = new Datepicker(); // singleton instance $.datepicker.initialized = false; $.datepicker.uuid = new Date().getTime(); -$.datepicker.version = "1.10.1"; - -// Workaround for #4055 -// Add another global to avoid noConflict issues with inline event handlers -window["DP_jQuery_" + dpuuid] = $; +$.datepicker.version = "1.10.4"; })(jQuery); |