Selectable: Remove uses of self var; use that var.

This commit is contained in:
Scott González 2012-05-09 16:07:49 -04:00
parent 84c8ba014e
commit 71c0562f51

View File

@ -24,7 +24,7 @@ $.widget("ui.selectable", $.ui.mouse, {
tolerance: 'touch'
},
_create: function() {
var self = this;
var that = this;
this.element.addClass("ui-selectable");
@ -33,7 +33,7 @@ $.widget("ui.selectable", $.ui.mouse, {
// cache selectee children based on filter
var selectees;
this.refresh = function() {
selectees = $(self.options.filter, self.element[0]);
selectees = $(that.options.filter, that.element[0]);
selectees.addClass("ui-selectee");
selectees.each(function() {
var $this = $(this);
@ -75,7 +75,7 @@ $.widget("ui.selectable", $.ui.mouse, {
},
_mouseStart: function(event) {
var self = this;
var that = this;
this.opos = [event.pageX, event.pageY];
@ -110,7 +110,7 @@ $.widget("ui.selectable", $.ui.mouse, {
selectee.$element.addClass('ui-unselecting');
selectee.unselecting = true;
// selectable UNSELECTING callback
self._trigger("unselecting", event, {
that._trigger("unselecting", event, {
unselecting: selectee.element
});
}
@ -128,11 +128,11 @@ $.widget("ui.selectable", $.ui.mouse, {
selectee.selected = doSelect;
// selectable (UN)SELECTING callback
if (doSelect) {
self._trigger("selecting", event, {
that._trigger("selecting", event, {
selecting: selectee.element
});
} else {
self._trigger("unselecting", event, {
that._trigger("unselecting", event, {
unselecting: selectee.element
});
}
@ -143,7 +143,7 @@ $.widget("ui.selectable", $.ui.mouse, {
},
_mouseDrag: function(event) {
var self = this;
var that = this;
this.dragged = true;
if (this.options.disabled)
@ -159,7 +159,7 @@ $.widget("ui.selectable", $.ui.mouse, {
this.selectees.each(function() {
var selectee = $.data(this, "selectable-item");
//prevent helper from being selected if appendTo: selectable
if (!selectee || selectee.element == self.element[0])
if (!selectee || selectee.element == that.element[0])
return;
var hit = false;
if (options.tolerance == 'touch') {
@ -182,7 +182,7 @@ $.widget("ui.selectable", $.ui.mouse, {
selectee.$element.addClass('ui-selecting');
selectee.selecting = true;
// selectable SELECTING callback
self._trigger("selecting", event, {
that._trigger("selecting", event, {
selecting: selectee.element
});
}
@ -202,7 +202,7 @@ $.widget("ui.selectable", $.ui.mouse, {
selectee.unselecting = true;
}
// selectable UNSELECTING callback
self._trigger("unselecting", event, {
that._trigger("unselecting", event, {
unselecting: selectee.element
});
}
@ -215,7 +215,7 @@ $.widget("ui.selectable", $.ui.mouse, {
selectee.$element.addClass('ui-unselecting');
selectee.unselecting = true;
// selectable UNSELECTING callback
self._trigger("unselecting", event, {
that._trigger("unselecting", event, {
unselecting: selectee.element
});
}
@ -227,7 +227,7 @@ $.widget("ui.selectable", $.ui.mouse, {
},
_mouseStop: function(event) {
var self = this;
var that = this;
this.dragged = false;
@ -238,7 +238,7 @@ $.widget("ui.selectable", $.ui.mouse, {
selectee.$element.removeClass('ui-unselecting');
selectee.unselecting = false;
selectee.startselected = false;
self._trigger("unselected", event, {
that._trigger("unselected", event, {
unselected: selectee.element
});
});
@ -248,7 +248,7 @@ $.widget("ui.selectable", $.ui.mouse, {
selectee.selecting = false;
selectee.selected = true;
selectee.startselected = true;
self._trigger("selected", event, {
that._trigger("selected", event, {
selected: selectee.element
});
});