]> source.dussan.org Git - jquery-ui.git/commitdiff
draggable: connectToSortable couldn't accept strings (fixes #3984)
authorPaul Bakaus <paul.bakaus@googlemail.com>
Thu, 29 Jan 2009 18:36:55 +0000 (18:36 +0000)
committerPaul Bakaus <paul.bakaus@googlemail.com>
Thu, 29 Jan 2009 18:36:55 +0000 (18:36 +0000)
demos/draggable/sortable.html
ui/ui.draggable.js

index fdaa18e2b42883b254f8466d010394a0fa6dfb38..01bc8ff9ee4bc681aba859cdf6024ea75216db71 100644 (file)
@@ -18,7 +18,7 @@
                        revert: true
                });
                $("#draggable").draggable({
-                       connectToSortable: ['#sortable'],
+                       connectToSortable: '#sortable',
                        helper: 'clone',
                        revert: 'invalid'
                });
index 199de61523dd177e446eb3110bafe8ac8d527fc7..e8524679b6f3bc4907f87c3083c7f29b2e86eb1b 100644 (file)
@@ -436,7 +436,7 @@ $.ui.plugin.add("draggable", "connectToSortable", {
                $(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
-                       $(this+'').each(function() {
+                       $(typeof this == 'string' ? this+'': this).each(function() {
                                if($.data(this, 'sortable')) {
                                        var sortable = $.data(this, 'sortable');
                                        inst.sortables.push({