]> source.dussan.org Git - jquery-ui.git/commitdiff
sortable: fixed connectToSortable option, wasn't working with Arrays as described...
authorPaul Bakaus <paul.bakaus@googlemail.com>
Thu, 11 Dec 2008 15:02:21 +0000 (15:02 +0000)
committerPaul Bakaus <paul.bakaus@googlemail.com>
Thu, 11 Dec 2008 15:02:21 +0000 (15:02 +0000)
ui/ui.draggable.js

index d1eeef65986982d336c55cd01d3192df1216d68c..f667c3b361e8df6791c19733638251c1a6eda160 100644 (file)
@@ -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);
+                               }
+                       });
                });
 
        },