]> source.dussan.org Git - jquery-ui.git/commitdiff
Draggable: Removed ridiculousness (some of it anyway).
authorScott González <scott.gonzalez@gmail.com>
Thu, 5 Feb 2009 03:44:08 +0000 (03:44 +0000)
committerScott González <scott.gonzalez@gmail.com>
Thu, 5 Feb 2009 03:44:08 +0000 (03:44 +0000)
ui/ui.draggable.js

index 3ffb86b4600e6e621a97c4dbe3a6e62a29d9b87f..4592aadb9a6b2cbc896c59723c536560cc1803fc 100644 (file)
@@ -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);
+                       }
                });
 
        },