Skip to content

Commit f813481

Browse files
committed
Mouse: Use 'that' instead of 'self'. Partial fix for #5404 - remove uses of 'var self = this;'
1 parent 861842d commit f813481

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

ui/jquery.ui.mouse.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ $.widget("ui.mouse", {
2525
delay: 0
2626
},
2727
_mouseInit: function() {
28-
var self = this;
28+
var that = this;
2929

3030
this.element
3131
.bind('mousedown.'+this.widgetName, function(event) {
32-
return self._mouseDown(event);
32+
return that._mouseDown(event);
3333
})
3434
.bind('click.'+this.widgetName, function(event) {
35-
if (true === $.data(event.target, self.widgetName + '.preventClickEvent')) {
36-
$.removeData(event.target, self.widgetName + '.preventClickEvent');
35+
if (true === $.data(event.target, that.widgetName + '.preventClickEvent')) {
36+
$.removeData(event.target, that.widgetName + '.preventClickEvent');
3737
event.stopImmediatePropagation();
3838
return false;
3939
}
@@ -57,7 +57,7 @@ $.widget("ui.mouse", {
5757

5858
this._mouseDownEvent = event;
5959

60-
var self = this,
60+
var that = this,
6161
btnIsLeft = (event.which == 1),
6262
// event.target.nodeName works around a bug in IE 8 with
6363
// disabled inputs (#7620)
@@ -69,7 +69,7 @@ $.widget("ui.mouse", {
6969
this.mouseDelayMet = !this.options.delay;
7070
if (!this.mouseDelayMet) {
7171
this._mouseDelayTimer = setTimeout(function() {
72-
self.mouseDelayMet = true;
72+
that.mouseDelayMet = true;
7373
}, this.options.delay);
7474
}
7575

@@ -88,10 +88,10 @@ $.widget("ui.mouse", {
8888

8989
// these delegates are required to keep context
9090
this._mouseMoveDelegate = function(event) {
91-
return self._mouseMove(event);
91+
return that._mouseMove(event);
9292
};
9393
this._mouseUpDelegate = function(event) {
94-
return self._mouseUp(event);
94+
return that._mouseUp(event);
9595
};
9696
$(document)
9797
.bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)

0 commit comments

Comments
 (0)