tolerance: 'touch'
},
_create: function() {
- var self = this;
+ var that = this;
this.element.addClass("ui-selectable");
// 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);
},
_mouseStart: function(event) {
- var self = this;
+ var that = this;
this.opos = [event.pageX, event.pageY];
selectee.$element.addClass('ui-unselecting');
selectee.unselecting = true;
// selectable UNSELECTING callback
- self._trigger("unselecting", event, {
+ that._trigger("unselecting", event, {
unselecting: selectee.element
});
}
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
});
}
},
_mouseDrag: function(event) {
- var self = this;
+ var that = this;
this.dragged = true;
if (this.options.disabled)
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') {
selectee.$element.addClass('ui-selecting');
selectee.selecting = true;
// selectable SELECTING callback
- self._trigger("selecting", event, {
+ that._trigger("selecting", event, {
selecting: selectee.element
});
}
selectee.unselecting = true;
}
// selectable UNSELECTING callback
- self._trigger("unselecting", event, {
+ that._trigger("unselecting", event, {
unselecting: selectee.element
});
}
selectee.$element.addClass('ui-unselecting');
selectee.unselecting = true;
// selectable UNSELECTING callback
- self._trigger("unselecting", event, {
+ that._trigger("unselecting", event, {
unselecting: selectee.element
});
}
},
_mouseStop: function(event) {
- var self = this;
+ var that = this;
this.dragged = false;
selectee.$element.removeClass('ui-unselecting');
selectee.unselecting = false;
selectee.startselected = false;
- self._trigger("unselected", event, {
+ that._trigger("unselected", event, {
unselected: selectee.element
});
});
selectee.selecting = false;
selectee.selected = true;
selectee.startselected = true;
- self._trigger("selected", event, {
+ that._trigger("selected", event, {
selected: selectee.element
});
});