]> source.dussan.org Git - jquery-ui.git/commitdiff
Mouse: Use 'that' instead of 'self'. Partial fix for #5404 - remove uses of 'var...
authorScott González <scott.gonzalez@gmail.com>
Sun, 12 Feb 2012 14:31:06 +0000 (09:31 -0500)
committerScott González <scott.gonzalez@gmail.com>
Sun, 12 Feb 2012 14:31:06 +0000 (09:31 -0500)
ui/jquery.ui.mouse.js

index 888fbedfed206a79353204e21009bab6e0281294..b1826aa233c9890af562e1e3b5643c6093e2ebfc 100644 (file)
@@ -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)