From c36b43d0ee3cf7e10d82d21e3a4ca6cb954f4c16 Mon Sep 17 00:00:00 2001 From: Jay Oster Date: Thu, 15 Sep 2011 17:02:18 -0700 Subject: [PATCH] Datepicker: Fix `this` reference in _hideDatepicker(). Fixed #7722 - Datepicker: Does not properly clear current instance when hidden. --- ui/jquery.ui.datepicker.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js index 0b6fb2218..a5ff08c63 100644 --- a/ui/jquery.ui.datepicker.js +++ b/ui/jquery.ui.datepicker.js @@ -807,9 +807,10 @@ $.extend(Datepicker.prototype, { if (this._datepickerShowing) { var showAnim = this._get(inst, 'showAnim'); var duration = this._get(inst, 'duration'); + var self = this; var postProcess = function() { $.datepicker._tidyDialog(inst); - this._curInst = null; + self._curInst = null; }; // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed