mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-12-07 06:14:24 +00:00
draggable: connectToSortable couldn't accept strings (fixes #3984)
This commit is contained in:
parent
d18d1a2d68
commit
3b92895a7e
@ -18,7 +18,7 @@
|
|||||||
revert: true
|
revert: true
|
||||||
});
|
});
|
||||||
$("#draggable").draggable({
|
$("#draggable").draggable({
|
||||||
connectToSortable: ['#sortable'],
|
connectToSortable: '#sortable',
|
||||||
helper: 'clone',
|
helper: 'clone',
|
||||||
revert: 'invalid'
|
revert: 'invalid'
|
||||||
});
|
});
|
||||||
|
@ -436,7 +436,7 @@ $.ui.plugin.add("draggable", "connectToSortable", {
|
|||||||
$(o.connectToSortable).each(function() {
|
$(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,
|
// '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
|
// so we have to append '' to make it anonymous again
|
||||||
$(this+'').each(function() {
|
$(typeof this == 'string' ? this+'': this).each(function() {
|
||||||
if($.data(this, 'sortable')) {
|
if($.data(this, 'sortable')) {
|
||||||
var sortable = $.data(this, 'sortable');
|
var sortable = $.data(this, 'sortable');
|
||||||
inst.sortables.push({
|
inst.sortables.push({
|
||||||
|
Loading…
Reference in New Issue
Block a user