diff options
author | Paul Bakaus <paul.bakaus@googlemail.com> | 2008-12-11 15:02:21 +0000 |
---|---|---|
committer | Paul Bakaus <paul.bakaus@googlemail.com> | 2008-12-11 15:02:21 +0000 |
commit | a7dae90eff7c96c052e557befc1e56667f9ab331 (patch) | |
tree | fb3fcc3a922c7fd69762f1ed151c97995119009f | |
parent | e8cb4b0604d4fadebf16054b4c0bc9e8a9158d83 (diff) | |
download | jquery-ui-a7dae90eff7c96c052e557befc1e56667f9ab331.tar.gz jquery-ui-a7dae90eff7c96c052e557befc1e56667f9ab331.zip |
sortable: fixed connectToSortable option, wasn't working with Arrays as described in the documentation
-rw-r--r-- | ui/ui.draggable.js | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/ui/ui.draggable.js b/ui/ui.draggable.js index d1eeef659..f667c3b36 100644 --- a/ui/ui.draggable.js +++ b/ui/ui.draggable.js @@ -395,15 +395,19 @@ $.ui.plugin.add("draggable", "connectToSortable", { var inst = $(this).data("draggable"); inst.sortables = []; $(ui.options.connectToSortable).each(function() { - if($.data(this, 'sortable')) { - var sortable = $.data(this, 'sortable'); - inst.sortables.push({ - instance: sortable, - shouldRevert: sortable.options.revert - }); - sortable._refreshItems(); //Do a one-time refresh at start to refresh the containerCache - sortable._propagate("activate", event, inst); - } + // '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 + $(this+'').each(function() { + if($.data(this, 'sortable')) { + var sortable = $.data(this, 'sortable'); + inst.sortables.push({ + instance: sortable, + shouldRevert: sortable.options.revert + }); + sortable._refreshItems(); //Do a one-time refresh at start to refresh the containerCache + sortable._propagate("activate", event, inst); + } + }); }); }, |