aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorMike Sherov <mike.sherov@gmail.com>2014-08-24 21:08:02 -0400
committerMike Sherov <mike.sherov@gmail.com>2014-08-25 08:24:56 -0400
commit27ed20715f4b3e256f5279825ac551bbfcdfbe81 (patch)
tree5d1d1e7f6f8a03e14c268c9447ebab0fb36d647f /ui
parent1cc380778b99c87acc82f363f6376d11d4d3759a (diff)
downloadjquery-ui-27ed20715f4b3e256f5279825ac551bbfcdfbe81.tar.gz
jquery-ui-27ed20715f4b3e256f5279825ac551bbfcdfbe81.zip
Draggable: Ensure css is always restored after connectToSortable drag
Fixes #9675
Diffstat (limited to 'ui')
-rw-r--r--ui/draggable.js15
1 files changed, 8 insertions, 7 deletions
diff --git a/ui/draggable.js b/ui/draggable.js
index d290ea539..ba8eca42b 100644
--- a/ui/draggable.js
+++ b/ui/draggable.js
@@ -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