aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorMike Sherov <mike.sherov@gmail.com>2014-08-24 21:12:16 -0400
committerMike Sherov <mike.sherov@gmail.com>2014-08-25 18:23:11 -0400
commit368fc8395b60b0f1fcfd0ceebe697709052ab44d (patch)
treea7edc495c50edfcbecedb3d8cca1d380c87250da /ui
parente8c99b9abf7ca9368668ee5886e469d31ea33c09 (diff)
downloadjquery-ui-368fc8395b60b0f1fcfd0ceebe697709052ab44d.tar.gz
jquery-ui-368fc8395b60b0f1fcfd0ceebe697709052ab44d.zip
Draggable: Clarify comments and whitespace in connectToSortable
Diffstat (limited to 'ui')
-rw-r--r--ui/draggable.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/ui/draggable.js b/ui/draggable.js
index 87176150e..7ad5d0c37 100644
--- a/ui/draggable.js
+++ b/ui/draggable.js
@@ -732,7 +732,6 @@ $.ui.plugin.add("draggable", "connectToSortable", {
$.each(inst.sortables, function() {
if (this.instance.isOver) {
-
this.instance.isOver = 0;
// Allow this sortable to handle removing the helper
@@ -751,6 +750,8 @@ $.ui.plugin.add("draggable", "connectToSortable", {
//Trigger the stop of the sortable
this.instance._mouseStop(event);
+ // Once drag has ended, the sortable should return to using
+ // its original helper, not the shared helper from draggable
this.instance.options.helper = this.instance.options._helper;
} else {
@@ -812,7 +813,7 @@ $.ui.plugin.add("draggable", "connectToSortable", {
return ui.helper[ 0 ];
};
- // Fire the start event of the sortable with our passed browser event,
+ // Fire the start events of the sortable with our passed browser event,
// and our own helper (so it doesn't create a new one)
event.target = sortable.currentItem[ 0 ];
sortable._mouseCapture( event, true );
@@ -829,7 +830,8 @@ $.ui.plugin.add("draggable", "connectToSortable", {
draggable._trigger( "toSortable", event );
- // draggable revert needs this variable
+ // Inform draggable that the helper is in a valid drop zone,
+ // used solely in the revert option to handle "valid/invalid".
draggable.dropped = sortable.element;
// hack so receive/update callbacks work (mostly)
@@ -860,7 +862,6 @@ $.ui.plugin.add("draggable", "connectToSortable", {
sortable.options.revert = false;
sortable._trigger( "out", event, sortable._uiHash( sortable ) );
-
sortable._mouseStop( event, true );
// restore sortable behaviors that were modfied
@@ -879,7 +880,7 @@ $.ui.plugin.add("draggable", "connectToSortable", {
draggable._trigger( "fromSortable", event );
- // draggable revert needs that
+ // Inform draggable that the helper is no longer in a valid drop zone
draggable.dropped = false;
}
}