From 3b92895a7e5b89815e66a051d432cdf67f6646cc Mon Sep 17 00:00:00 2001 From: Paul Bakaus Date: Thu, 29 Jan 2009 18:36:55 +0000 Subject: [PATCH] draggable: connectToSortable couldn't accept strings (fixes #3984) --- demos/draggable/sortable.html | 2 +- ui/ui.draggable.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/demos/draggable/sortable.html b/demos/draggable/sortable.html index fdaa18e2b..01bc8ff9e 100644 --- a/demos/draggable/sortable.html +++ b/demos/draggable/sortable.html @@ -18,7 +18,7 @@ revert: true }); $("#draggable").draggable({ - connectToSortable: ['#sortable'], + connectToSortable: '#sortable', helper: 'clone', revert: 'invalid' }); diff --git a/ui/ui.draggable.js b/ui/ui.draggable.js index 199de6152..e8524679b 100644 --- a/ui/ui.draggable.js +++ b/ui/ui.draggable.js @@ -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({