]> source.dussan.org Git - jquery-ui.git/commitdiff
Sortable: Added a variable to track if initialization is complete. Fixes #4759 -...
authorSpoonNZ <spoonlikesham@gmail.com>
Fri, 20 Jan 2012 03:54:47 +0000 (16:54 +1300)
committerScott González <scott.gonzalez@gmail.com>
Fri, 20 Jan 2012 16:01:32 +0000 (11:01 -0500)
ui/jquery.ui.sortable.js

index 62d227a3d2b1c22453ced135143c830d1d87049b..60056945151eb2f41c6818474875641ae51ef34a 100644 (file)
@@ -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--){