aboutsummaryrefslogtreecommitdiffstats
path: root/ui/draggable.js
diff options
context:
space:
mode:
authorMike Sherov <mike.sherov@gmail.com>2014-08-24 15:06:51 -0400
committerMike Sherov <mike.sherov@gmail.com>2014-08-24 21:30:49 -0400
commit1cc380778b99c87acc82f363f6376d11d4d3759a (patch)
tree05918e9f39cfeea466ef80ce6d6480c50badacd4 /ui/draggable.js
parentc7bec85cfa7711bb2612278eb980d0d14dade3b9 (diff)
downloadjquery-ui-1cc380778b99c87acc82f363f6376d11d4d3759a.tar.gz
jquery-ui-1cc380778b99c87acc82f363f6376d11d4d3759a.zip
Draggable: Ensure correct widget removes helper in connectToSortable
Diffstat (limited to 'ui/draggable.js')
-rw-r--r--ui/draggable.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/ui/draggable.js b/ui/draggable.js
index 997bba107..d290ea539 100644
--- a/ui/draggable.js
+++ b/ui/draggable.js
@@ -729,13 +729,16 @@ $.ui.plugin.add("draggable", "connectToSortable", {
item: inst.element
});
+ inst.cancelHelperRemoval = false;
+
$.each(inst.sortables, function() {
if (this.instance.isOver) {
this.instance.isOver = 0;
- inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
- this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
+ // Allow this sortable to handle removing the helper
+ inst.cancelHelperRemoval = true;
+ this.instance.cancelHelperRemoval = false;
//The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: "valid/invalid"
if (this.shouldRevert) {
@@ -755,7 +758,11 @@ $.ui.plugin.add("draggable", "connectToSortable", {
left: ""
});
} else {
- this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance
+ // Prevent this Sortable from removing the helper.
+ // However, don't set the draggable to remove the helper
+ // either as another connected Sortable may yet handle the removal.
+ this.instance.cancelHelperRemoval = true;
+
this.instance._trigger("deactivate", event, uiSortable);
}