Skip to content

Commit

Permalink
Draggable: Removed ridiculousness (some of it anyway).
Browse files Browse the repository at this point in the history
  • Loading branch information
scottgonzalez committed Feb 5, 2009
1 parent 57f0188 commit 0c8eed6
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions ui/ui.draggable.js
Expand Up @@ -439,20 +439,15 @@ $.ui.plugin.add("draggable", "connectToSortable", {
var inst = $(this).data("draggable"), o = inst.options; var inst = $(this).data("draggable"), o = inst.options;
inst.sortables = []; inst.sortables = [];
$(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, var sortable = $.data(this, 'sortable');
// so we have to append '' to make it anonymous again if (sortable && !sortable.options.disabled) {
$(typeof this == 'string' ? this+'': this).each(function() { inst.sortables.push({
if($.data(this, 'sortable')) { instance: sortable,
var sortable = $.data(this, 'sortable'); shouldRevert: sortable.options.revert
if (sortable.options.disabled) { return; } });
inst.sortables.push({ sortable._refreshItems(); //Do a one-time refresh at start to refresh the containerCache
instance: sortable, sortable._trigger("activate", event, inst);
shouldRevert: sortable.options.revert }
});
sortable._refreshItems(); //Do a one-time refresh at start to refresh the containerCache
sortable._trigger("activate", event, inst);
}
});
}); });


}, },
Expand Down

0 comments on commit 0c8eed6

Please sign in to comment.