From: Scott González Date: Wed, 3 Apr 2013 20:12:50 +0000 (-0400) Subject: Datepicker: Remove unnecessary global variable now that we don't use inline event... X-Git-Tag: 1.10.3~25 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0aef038a4350cb557470b914121764dec468d6da;p=jquery-ui.git Datepicker: Remove unnecessary global variable now that we don't use inline event handlers anymore. (cherry picked from commit cb42ba6fd6307a8425a1af89329869fcc613cefe) --- diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js index efee7a819..d26dbb45b 100644 --- a/ui/jquery.ui.datepicker.js +++ b/ui/jquery.ui.datepicker.js @@ -16,7 +16,6 @@ $.extend($.ui, { datepicker: { version: "@VERSION" } }); var PROP_NAME = "datepicker", - dpuuid = new Date().getTime(), instActive; /* Date picker manager. @@ -1558,27 +1557,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; } }; @@ -2043,8 +2042,4 @@ $.datepicker.initialized = false; $.datepicker.uuid = new Date().getTime(); $.datepicker.version = "@VERSION"; -// Workaround for #4055 -// Add another global to avoid noConflict issues with inline event handlers -window["DP_jQuery_" + dpuuid] = $; - })(jQuery);