Skip to content

Commit

Permalink
Draggable: Ensure css is always restored after connectToSortable drag
Browse files Browse the repository at this point in the history
Fixes #9675
  • Loading branch information
mikesherov committed Aug 25, 2014
1 parent 1cc3807 commit 27ed207
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions ui/draggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -744,19 +744,20 @@ $.ui.plugin.add("draggable", "connectToSortable", {
if (this.shouldRevert) {
this.instance.options.revert = this.shouldRevert;
}
// Use _storedCSS To restore properties in the sortable,
// as this also handles revert (#9675) since the draggable
// may have modified them in unexpected ways (#8809)
this.instance._storedCSS = {
position: this.instance.placeholder.css( "position" ),
top: this.instance.placeholder.css( "top" ),
left: this.instance.placeholder.css( "left" )
};

//Trigger the stop of the sortable
this.instance._mouseStop(event);

this.instance.options.helper = this.instance.options._helper;

// restore properties in the sortable, since the draggable may have
// modified them in unexpected ways (#8809)
this.instance.currentItem.css({
position: this.instance.placeholder.css( "position" ),
top: "",
left: ""
});
} else {
// Prevent this Sortable from removing the helper.
// However, don't set the draggable to remove the helper
Expand Down

0 comments on commit 27ed207

Please sign in to comment.