diff options
author | Scott González <scott.gonzalez@gmail.com> | 2009-02-05 03:44:08 +0000 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2009-02-05 03:44:08 +0000 |
commit | 0c8eed67f5174633ce6d88f0a98b0f3264c4f082 (patch) | |
tree | 0fd5817e859272f28be74727c49bd8fc2967a974 | |
parent | 57f0188239843afdd0932fbf9186263ba4cab6da (diff) | |
download | jquery-ui-0c8eed67f5174633ce6d88f0a98b0f3264c4f082.tar.gz jquery-ui-0c8eed67f5174633ce6d88f0a98b0f3264c4f082.zip |
Draggable: Removed ridiculousness (some of it anyway).
-rw-r--r-- | ui/ui.draggable.js | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/ui/ui.draggable.js b/ui/ui.draggable.js index 3ffb86b46..4592aadb9 100644 --- a/ui/ui.draggable.js +++ b/ui/ui.draggable.js @@ -439,20 +439,15 @@ $.ui.plugin.add("draggable", "connectToSortable", { var inst = $(this).data("draggable"), o = inst.options; inst.sortables = []; $(o.connectToSortable).each(function() { - // 'this' points to a string, and should therefore resolved as query, but instead, if the string is assigned to a variable, it loops through the strings properties, - // so we have to append '' to make it anonymous again - $(typeof this == 'string' ? this+'': this).each(function() { - if($.data(this, 'sortable')) { - var sortable = $.data(this, 'sortable'); - if (sortable.options.disabled) { return; } - inst.sortables.push({ - instance: sortable, - shouldRevert: sortable.options.revert - }); - sortable._refreshItems(); //Do a one-time refresh at start to refresh the containerCache - sortable._trigger("activate", event, inst); - } - }); + var sortable = $.data(this, 'sortable'); + if (sortable && !sortable.options.disabled) { + inst.sortables.push({ + instance: sortable, + shouldRevert: sortable.options.revert + }); + sortable._refreshItems(); //Do a one-time refresh at start to refresh the containerCache + sortable._trigger("activate", event, inst); + } }); }, |