Skip to content
Permalink
Browse files

sortable: fixed connectToSortable option, wasn't working with Arrays …

…as described in the documentation
  • Loading branch information
Paul Bakaus
Paul Bakaus committed Dec 11, 2008
1 parent e8cb4b0 commit a7dae90eff7c96c052e557befc1e56667f9ab331
Showing with 13 additions and 9 deletions.
  1. +13 −9 ui/ui.draggable.js
@@ -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);
}
});
});

},

0 comments on commit a7dae90

Please sign in to comment.
You can’t perform that action at this time.