Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Sortable: Added a variable to track if initialization is complete. Fi…

…xes #4759 - a major optimization is possible in sortable().
  • Loading branch information...
commit ba6916f22ac3fac993975abc0f86d6cb0bf9c08d 1 parent 956c2cd
@SpoonNZ SpoonNZ authored scottgonzalez committed
Showing with 5 additions and 1 deletion.
  1. +5 −1 ui/jquery.ui.sortable.js
View
6 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--){
Please sign in to comment.
Something went wrong with that request. Please try again.