diff options
author | SpoonNZ <spoonlikesham@gmail.com> | 2012-01-20 16:54:47 +1300 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-01-20 11:03:23 -0500 |
commit | b00faa95d0d372f345e24f9abe9d16a2b67ca258 (patch) | |
tree | 573879ae7184153b19fb7059f468cc99d44e4d39 /ui | |
parent | 9e4455f52d721f2efd4c91037bcd3daf24635599 (diff) | |
download | jquery-ui-b00faa95d0d372f345e24f9abe9d16a2b67ca258.tar.gz jquery-ui-b00faa95d0d372f345e24f9abe9d16a2b67ca258.zip |
Sortable: Added a variable to track if initialization is complete. Fixes #4759 - a major optimization is possible in sortable().
(cherry picked from commit ba6916f22ac3fac993975abc0f86d6cb0bf9c08d)
Diffstat (limited to 'ui')
-rw-r--r-- | ui/jquery.ui.sortable.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js index 563e63c09..54adacebc 100644 --- a/ui/jquery.ui.sortable.js +++ b/ui/jquery.ui.sortable.js @@ -16,6 +16,7 @@ $.widget("ui.sortable", $.ui.mouse, { widgetEventPrefix: "sort", + ready: false, options: { appendTo: "parent", axis: false, @@ -57,6 +58,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--){ |