@@ -732,7 +732,6 @@ $.ui.plugin.add("draggable", "connectToSortable", {
732
732
733
733
$ . each ( inst . sortables , function ( ) {
734
734
if ( this . instance . isOver ) {
735
-
736
735
this . instance . isOver = 0 ;
737
736
738
737
// Allow this sortable to handle removing the helper
@@ -751,6 +750,8 @@ $.ui.plugin.add("draggable", "connectToSortable", {
751
750
//Trigger the stop of the sortable
752
751
this . instance . _mouseStop ( event ) ;
753
752
753
+ // Once drag has ended, the sortable should return to using
754
+ // its original helper, not the shared helper from draggable
754
755
this . instance . options . helper = this . instance . options . _helper ;
755
756
756
757
} else {
@@ -812,7 +813,7 @@ $.ui.plugin.add("draggable", "connectToSortable", {
812
813
return ui . helper [ 0 ] ;
813
814
} ;
814
815
815
- // Fire the start event of the sortable with our passed browser event,
816
+ // Fire the start events of the sortable with our passed browser event,
816
817
// and our own helper (so it doesn't create a new one)
817
818
event . target = sortable . currentItem [ 0 ] ;
818
819
sortable . _mouseCapture ( event , true ) ;
@@ -829,7 +830,8 @@ $.ui.plugin.add("draggable", "connectToSortable", {
829
830
830
831
draggable . _trigger ( "toSortable" , event ) ;
831
832
832
- // draggable revert needs this variable
833
+ // Inform draggable that the helper is in a valid drop zone,
834
+ // used solely in the revert option to handle "valid/invalid".
833
835
draggable . dropped = sortable . element ;
834
836
835
837
// hack so receive/update callbacks work (mostly)
@@ -860,7 +862,6 @@ $.ui.plugin.add("draggable", "connectToSortable", {
860
862
sortable . options . revert = false ;
861
863
862
864
sortable . _trigger ( "out" , event , sortable . _uiHash ( sortable ) ) ;
863
-
864
865
sortable . _mouseStop ( event , true ) ;
865
866
866
867
// restore sortable behaviors that were modfied
@@ -879,7 +880,7 @@ $.ui.plugin.add("draggable", "connectToSortable", {
879
880
880
881
draggable . _trigger ( "fromSortable" , event ) ;
881
882
882
- // draggable revert needs that
883
+ // Inform draggable that the helper is no longer in a valid drop zone
883
884
draggable . dropped = false ;
884
885
}
885
886
}
0 commit comments