mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
sortable: fixed connectToSortable option, wasn't working with Arrays as described in the documentation
This commit is contained in:
parent
e8cb4b0604
commit
a7dae90eff
@ -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);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user