aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.sortable.js
diff options
context:
space:
mode:
authorSpoonNZ <spoonlikesham@gmail.com>2012-01-20 16:54:47 +1300
committerScott González <scott.gonzalez@gmail.com>2012-01-20 11:01:32 -0500
commitba6916f22ac3fac993975abc0f86d6cb0bf9c08d (patch)
tree51ec4493639108dbe77203e49e25f667fb412ce8 /ui/jquery.ui.sortable.js
parent956c2cd2a5a44d40a9b2fb0a8c05f765fa302c92 (diff)
downloadjquery-ui-ba6916f22ac3fac993975abc0f86d6cb0bf9c08d.tar.gz
jquery-ui-ba6916f22ac3fac993975abc0f86d6cb0bf9c08d.zip
Sortable: Added a variable to track if initialization is complete. Fixes #4759 - a major optimization is possible in sortable().
Diffstat (limited to 'ui/jquery.ui.sortable.js')
-rw-r--r--ui/jquery.ui.sortable.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js
index 62d227a3d..600569451 100644
--- a/ui/jquery.ui.sortable.js
+++ b/ui/jquery.ui.sortable.js
@@ -17,6 +17,7 @@
$.widget("ui.sortable", $.ui.mouse, {
version: "@VERSION",
widgetEventPrefix: "sort",
+ ready: false,
options: {
appendTo: "parent",
axis: false,
@@ -58,6 +59,9 @@ $.widget("ui.sortable", $.ui.mouse, {
//Initialize mouse events for interaction
this._mouseInit();
+
+ //We're ready to go
+ this.ready = true
},
@@ -571,7 +575,7 @@ $.widget("ui.sortable", $.ui.mouse, {
var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]];
var connectWith = this._connectWith();
- if(connectWith) {
+ if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down
for (var i = connectWith.length - 1; i >= 0; i--){
var cur = $(connectWith[i]);
for (var j = cur.length - 1; j >= 0; j--){