annotate jquery-ui/development-bundle/ui/jquery.ui.selectable.js @ 0:b2e4605f20b2

beta version
author dwinter
date Thu, 30 Jun 2011 09:07:49 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
1 /*
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
2 * jQuery UI Selectable 1.8.11
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
3 *
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
4 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
5 * Dual licensed under the MIT or GPL Version 2 licenses.
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
6 * http://jquery.org/license
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
7 *
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
8 * http://docs.jquery.com/UI/Selectables
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
9 *
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
10 * Depends:
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
11 * jquery.ui.core.js
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
12 * jquery.ui.mouse.js
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
13 * jquery.ui.widget.js
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
14 */
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
15 (function( $, undefined ) {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
16
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
17 $.widget("ui.selectable", $.ui.mouse, {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
18 options: {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
19 appendTo: 'body',
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
20 autoRefresh: true,
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
21 distance: 0,
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
22 filter: '*',
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
23 tolerance: 'touch'
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
24 },
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
25 _create: function() {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
26 var self = this;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
27
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
28 this.element.addClass("ui-selectable");
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
29
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
30 this.dragged = false;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
31
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
32 // cache selectee children based on filter
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
33 var selectees;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
34 this.refresh = function() {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
35 selectees = $(self.options.filter, self.element[0]);
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
36 selectees.each(function() {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
37 var $this = $(this);
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
38 var pos = $this.offset();
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
39 $.data(this, "selectable-item", {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
40 element: this,
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
41 $element: $this,
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
42 left: pos.left,
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
43 top: pos.top,
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
44 right: pos.left + $this.outerWidth(),
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
45 bottom: pos.top + $this.outerHeight(),
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
46 startselected: false,
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
47 selected: $this.hasClass('ui-selected'),
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
48 selecting: $this.hasClass('ui-selecting'),
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
49 unselecting: $this.hasClass('ui-unselecting')
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
50 });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
51 });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
52 };
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
53 this.refresh();
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
54
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
55 this.selectees = selectees.addClass("ui-selectee");
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
56
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
57 this._mouseInit();
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
58
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
59 this.helper = $("<div class='ui-selectable-helper'></div>");
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
60 },
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
61
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
62 destroy: function() {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
63 this.selectees
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
64 .removeClass("ui-selectee")
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
65 .removeData("selectable-item");
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
66 this.element
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
67 .removeClass("ui-selectable ui-selectable-disabled")
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
68 .removeData("selectable")
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
69 .unbind(".selectable");
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
70 this._mouseDestroy();
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
71
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
72 return this;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
73 },
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
74
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
75 _mouseStart: function(event) {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
76 var self = this;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
77
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
78 this.opos = [event.pageX, event.pageY];
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
79
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
80 if (this.options.disabled)
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
81 return;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
82
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
83 var options = this.options;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
84
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
85 this.selectees = $(options.filter, this.element[0]);
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
86
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
87 this._trigger("start", event);
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
88
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
89 $(options.appendTo).append(this.helper);
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
90 // position helper (lasso)
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
91 this.helper.css({
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
92 "left": event.clientX,
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
93 "top": event.clientY,
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
94 "width": 0,
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
95 "height": 0
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
96 });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
97
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
98 if (options.autoRefresh) {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
99 this.refresh();
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
100 }
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
101
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
102 this.selectees.filter('.ui-selected').each(function() {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
103 var selectee = $.data(this, "selectable-item");
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
104 selectee.startselected = true;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
105 if (!event.metaKey) {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
106 selectee.$element.removeClass('ui-selected');
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
107 selectee.selected = false;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
108 selectee.$element.addClass('ui-unselecting');
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
109 selectee.unselecting = true;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
110 // selectable UNSELECTING callback
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
111 self._trigger("unselecting", event, {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
112 unselecting: selectee.element
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
113 });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
114 }
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
115 });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
116
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
117 $(event.target).parents().andSelf().each(function() {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
118 var selectee = $.data(this, "selectable-item");
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
119 if (selectee) {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
120 var doSelect = !event.metaKey || !selectee.$element.hasClass('ui-selected');
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
121 selectee.$element
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
122 .removeClass(doSelect ? "ui-unselecting" : "ui-selected")
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
123 .addClass(doSelect ? "ui-selecting" : "ui-unselecting");
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
124 selectee.unselecting = !doSelect;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
125 selectee.selecting = doSelect;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
126 selectee.selected = doSelect;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
127 // selectable (UN)SELECTING callback
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
128 if (doSelect) {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
129 self._trigger("selecting", event, {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
130 selecting: selectee.element
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
131 });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
132 } else {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
133 self._trigger("unselecting", event, {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
134 unselecting: selectee.element
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
135 });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
136 }
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
137 return false;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
138 }
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
139 });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
140
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
141 },
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
142
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
143 _mouseDrag: function(event) {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
144 var self = this;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
145 this.dragged = true;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
146
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
147 if (this.options.disabled)
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
148 return;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
149
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
150 var options = this.options;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
151
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
152 var x1 = this.opos[0], y1 = this.opos[1], x2 = event.pageX, y2 = event.pageY;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
153 if (x1 > x2) { var tmp = x2; x2 = x1; x1 = tmp; }
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
154 if (y1 > y2) { var tmp = y2; y2 = y1; y1 = tmp; }
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
155 this.helper.css({left: x1, top: y1, width: x2-x1, height: y2-y1});
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
156
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
157 this.selectees.each(function() {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
158 var selectee = $.data(this, "selectable-item");
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
159 //prevent helper from being selected if appendTo: selectable
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
160 if (!selectee || selectee.element == self.element[0])
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
161 return;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
162 var hit = false;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
163 if (options.tolerance == 'touch') {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
164 hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
165 } else if (options.tolerance == 'fit') {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
166 hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
167 }
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
168
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
169 if (hit) {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
170 // SELECT
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
171 if (selectee.selected) {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
172 selectee.$element.removeClass('ui-selected');
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
173 selectee.selected = false;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
174 }
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
175 if (selectee.unselecting) {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
176 selectee.$element.removeClass('ui-unselecting');
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
177 selectee.unselecting = false;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
178 }
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
179 if (!selectee.selecting) {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
180 selectee.$element.addClass('ui-selecting');
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
181 selectee.selecting = true;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
182 // selectable SELECTING callback
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
183 self._trigger("selecting", event, {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
184 selecting: selectee.element
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
185 });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
186 }
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
187 } else {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
188 // UNSELECT
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
189 if (selectee.selecting) {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
190 if (event.metaKey && selectee.startselected) {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
191 selectee.$element.removeClass('ui-selecting');
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
192 selectee.selecting = false;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
193 selectee.$element.addClass('ui-selected');
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
194 selectee.selected = true;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
195 } else {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
196 selectee.$element.removeClass('ui-selecting');
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
197 selectee.selecting = false;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
198 if (selectee.startselected) {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
199 selectee.$element.addClass('ui-unselecting');
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
200 selectee.unselecting = true;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
201 }
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
202 // selectable UNSELECTING callback
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
203 self._trigger("unselecting", event, {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
204 unselecting: selectee.element
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
205 });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
206 }
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
207 }
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
208 if (selectee.selected) {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
209 if (!event.metaKey && !selectee.startselected) {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
210 selectee.$element.removeClass('ui-selected');
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
211 selectee.selected = false;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
212
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
213 selectee.$element.addClass('ui-unselecting');
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
214 selectee.unselecting = true;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
215 // selectable UNSELECTING callback
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
216 self._trigger("unselecting", event, {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
217 unselecting: selectee.element
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
218 });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
219 }
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
220 }
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
221 }
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
222 });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
223
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
224 return false;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
225 },
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
226
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
227 _mouseStop: function(event) {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
228 var self = this;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
229
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
230 this.dragged = false;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
231
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
232 var options = this.options;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
233
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
234 $('.ui-unselecting', this.element[0]).each(function() {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
235 var selectee = $.data(this, "selectable-item");
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
236 selectee.$element.removeClass('ui-unselecting');
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
237 selectee.unselecting = false;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
238 selectee.startselected = false;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
239 self._trigger("unselected", event, {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
240 unselected: selectee.element
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
241 });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
242 });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
243 $('.ui-selecting', this.element[0]).each(function() {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
244 var selectee = $.data(this, "selectable-item");
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
245 selectee.$element.removeClass('ui-selecting').addClass('ui-selected');
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
246 selectee.selecting = false;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
247 selectee.selected = true;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
248 selectee.startselected = true;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
249 self._trigger("selected", event, {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
250 selected: selectee.element
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
251 });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
252 });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
253 this._trigger("stop", event);
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
254
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
255 this.helper.remove();
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
256
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
257 return false;
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
258 }
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
259
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
260 });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
261
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
262 $.extend($.ui.selectable, {
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
263 version: "1.8.11"
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
264 });
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
265
b2e4605f20b2 beta version
dwinter
parents:
diff changeset
266 })(jQuery);