aboutsummaryrefslogtreecommitdiffstats
path: root/ui/ui.selectable.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/ui.selectable.js')
-rw-r--r--ui/ui.selectable.js26
1 files changed, 13 insertions, 13 deletions
diff --git a/ui/ui.selectable.js b/ui/ui.selectable.js
index 7d8d8cc2b..b75bb9894 100644
--- a/ui/ui.selectable.js
+++ b/ui/ui.selectable.js
@@ -19,7 +19,7 @@ $.widget("ui.selectable", $.extend({}, $.ui.mouse, {
this.element.addClass("ui-selectable");
this.dragged = false;
-
+
// cache selectee children based on filter
var selectees;
this.refresh = function() {
@@ -42,7 +42,7 @@ $.widget("ui.selectable", $.extend({}, $.ui.mouse, {
});
};
this.refresh();
-
+
this.selectees = selectees.addClass("ui-selectee");
this._mouseInit();
@@ -72,17 +72,17 @@ $.widget("ui.selectable", $.extend({}, $.ui.mouse, {
if (this.options.disabled)
return;
-
+
var options = this.options;
-
+
this.selectees = $(options.filter, this.element[0]);
-
+
// selectable START callback
this.element.triggerHandler("selectablestart", [e, {
"selectable": this.element[0],
"options": options
}], options.start);
-
+
$('body').append(this.helper);
// position helper (lasso)
this.helper.css({
@@ -93,11 +93,11 @@ $.widget("ui.selectable", $.extend({}, $.ui.mouse, {
"width": 0,
"height": 0
});
-
+
if (options.autoRefresh) {
this.refresh();
}
-
+
this.selectees.filter('.ui-selected').each(function() {
var selectee = $.data(this, "selectable-item");
selectee.startselected = true;
@@ -127,14 +127,14 @@ $.widget("ui.selectable", $.extend({}, $.ui.mouse, {
if (this.options.disabled)
return;
-
+
var options = this.options;
-
+
var x1 = this.opos[0], y1 = this.opos[1], x2 = e.pageX, y2 = e.pageY;
if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; }
if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; }
this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1});
-
+
this.selectees.each(function() {
var selectee = $.data(this, "selectable-item");
//prevent helper from being selected if appendTo: selectable
@@ -146,7 +146,7 @@ $.widget("ui.selectable", $.extend({}, $.ui.mouse, {
} else if (options.tolerance == 'fit') {
hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
}
-
+
if (hit) {
// SELECT
if (selectee.selected) {
@@ -216,7 +216,7 @@ $.widget("ui.selectable", $.extend({}, $.ui.mouse, {
this.dragged = false;
var options = this.options;
-
+
$('.ui-unselecting', this.element[0]).each(function() {
var selectee = $.data(this, "selectable-item");
selectee.$element.removeClass('ui-unselecting');