Skip to content

Commit cb42ba6

Browse files
committed
Datepicker: Remove unnecessary global variable now that we don't use inline event handlers anymore.
1 parent 504b100 commit cb42ba6

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

ui/jquery.ui.datepicker.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
$.extend($.ui, { datepicker: { version: "@VERSION" } });
1717

1818
var PROP_NAME = "datepicker",
19-
dpuuid = new Date().getTime(),
2019
instActive;
2120

2221
function getZindex( elem ) {
@@ -1580,27 +1579,27 @@ $.extend(Datepicker.prototype, {
15801579
inst.dpDiv.find("[data-handler]").map(function () {
15811580
var handler = {
15821581
prev: function () {
1583-
window["DP_jQuery_" + dpuuid].datepicker._adjustDate(id, -stepMonths, "M");
1582+
$.datepicker._adjustDate(id, -stepMonths, "M");
15841583
},
15851584
next: function () {
1586-
window["DP_jQuery_" + dpuuid].datepicker._adjustDate(id, +stepMonths, "M");
1585+
$.datepicker._adjustDate(id, +stepMonths, "M");
15871586
},
15881587
hide: function () {
1589-
window["DP_jQuery_" + dpuuid].datepicker._hideDatepicker();
1588+
$.datepicker._hideDatepicker();
15901589
},
15911590
today: function () {
1592-
window["DP_jQuery_" + dpuuid].datepicker._gotoToday(id);
1591+
$.datepicker._gotoToday(id);
15931592
},
15941593
selectDay: function () {
1595-
window["DP_jQuery_" + dpuuid].datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this);
1594+
$.datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this);
15961595
return false;
15971596
},
15981597
selectMonth: function () {
1599-
window["DP_jQuery_" + dpuuid].datepicker._selectMonthYear(id, this, "M");
1598+
$.datepicker._selectMonthYear(id, this, "M");
16001599
return false;
16011600
},
16021601
selectYear: function () {
1603-
window["DP_jQuery_" + dpuuid].datepicker._selectMonthYear(id, this, "Y");
1602+
$.datepicker._selectMonthYear(id, this, "Y");
16041603
return false;
16051604
}
16061605
};
@@ -2065,8 +2064,4 @@ $.datepicker.initialized = false;
20652064
$.datepicker.uuid = new Date().getTime();
20662065
$.datepicker.version = "@VERSION";
20672066

2068-
// Workaround for #4055
2069-
// Add another global to avoid noConflict issues with inline event handlers
2070-
window["DP_jQuery_" + dpuuid] = $;
2071-
20722067
})(jQuery);

0 commit comments

Comments
 (0)