]> source.dussan.org Git - jquery-ui.git/commitdiff
sortable: connectWith should accept string selectors (fixes #3892, backward compatibi...
authorPaul Bakaus <paul.bakaus@googlemail.com>
Tue, 20 Jan 2009 16:34:21 +0000 (16:34 +0000)
committerPaul Bakaus <paul.bakaus@googlemail.com>
Tue, 20 Jan 2009 16:34:21 +0000 (16:34 +0000)
ui/ui.sortable.js

index aa97247933b76bf58de1146df1744d3d028cfb0d..54b136efc790993e8ed3073aec3bacaa4354512f 100644 (file)
@@ -469,8 +469,9 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, {
                var queries = [];
 
                if(this.options.connectWith && connected) {
-                       for (var i = this.options.connectWith.length - 1; i >= 0; i--){
-                               var cur = $(this.options.connectWith[i]);
+                       var connectWith = this.options.connectWith.constructor == String ? [this.options.connectWith] : this.options.connectWith;
+                       for (var i = connectWith.length - 1; i >= 0; i--){
+                               var cur = $(connectWith[i]);
                                for (var j = cur.length - 1; j >= 0; j--){
                                        var inst = $.data(cur[j], 'sortable');
                                        if(inst && inst != this && !inst.options.disabled) {