From: Scott González Date: Sun, 12 Feb 2012 14:31:06 +0000 (-0500) Subject: Mouse: Use 'that' instead of 'self'. Partial fix for #5404 - remove uses of 'var... X-Git-Tag: 1.9m7~54 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f81348111775bf97a9f5084f0092318ded3b1f26;p=jquery-ui.git Mouse: Use 'that' instead of 'self'. Partial fix for #5404 - remove uses of 'var self = this;' --- diff --git a/ui/jquery.ui.mouse.js b/ui/jquery.ui.mouse.js index 888fbedfe..b1826aa23 100644 --- a/ui/jquery.ui.mouse.js +++ b/ui/jquery.ui.mouse.js @@ -25,15 +25,15 @@ $.widget("ui.mouse", { delay: 0 }, _mouseInit: function() { - var self = this; + var that = this; this.element .bind('mousedown.'+this.widgetName, function(event) { - return self._mouseDown(event); + return that._mouseDown(event); }) .bind('click.'+this.widgetName, function(event) { - if (true === $.data(event.target, self.widgetName + '.preventClickEvent')) { - $.removeData(event.target, self.widgetName + '.preventClickEvent'); + if (true === $.data(event.target, that.widgetName + '.preventClickEvent')) { + $.removeData(event.target, that.widgetName + '.preventClickEvent'); event.stopImmediatePropagation(); return false; } @@ -57,7 +57,7 @@ $.widget("ui.mouse", { this._mouseDownEvent = event; - var self = this, + var that = this, btnIsLeft = (event.which == 1), // event.target.nodeName works around a bug in IE 8 with // disabled inputs (#7620) @@ -69,7 +69,7 @@ $.widget("ui.mouse", { this.mouseDelayMet = !this.options.delay; if (!this.mouseDelayMet) { this._mouseDelayTimer = setTimeout(function() { - self.mouseDelayMet = true; + that.mouseDelayMet = true; }, this.options.delay); } @@ -88,10 +88,10 @@ $.widget("ui.mouse", { // these delegates are required to keep context this._mouseMoveDelegate = function(event) { - return self._mouseMove(event); + return that._mouseMove(event); }; this._mouseUpDelegate = function(event) { - return self._mouseUp(event); + return that._mouseUp(event); }; $(document) .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)