Skip to content
Permalink
Browse files

Mouse: Use 'that' instead of 'self'. Partial fix for #5404 - remove u…

…ses of 'var self = this;'
  • Loading branch information
scottgonzalez committed Feb 12, 2012
1 parent 861842d commit f81348111775bf97a9f5084f0092318ded3b1f26
Showing with 8 additions and 8 deletions.
  1. +8 −8 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)

0 comments on commit f813481

Please sign in to comment.
You can’t perform that action at this time.