From: Paul Bakaus Date: Fri, 30 May 2008 10:07:49 +0000 (+0000) Subject: draggable: fixed issue with connectToSortable, where the helper property was not... X-Git-Tag: 1.5.1~271 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5b19d8e7236710a94e458e1e1b1e84b488f72ab0;p=jquery-ui.git draggable: fixed issue with connectToSortable, where the helper property was not properly restored later on --- diff --git a/ui/source/ui.draggable.js b/ui/source/ui.draggable.js index 7ef5f84e6..64e206245 100644 --- a/ui/source/ui.draggable.js +++ b/ui/source/ui.draggable.js @@ -460,7 +460,7 @@ //Also propagate receive event, since the sortable is actually receiving a element this.instance.element.triggerHandler("sortreceive", [e, $.extend(this.instance.ui(), { sender: inst.element })], this.instance.options["receive"]); - this.instance.options.helper = "original"; + this.instance.options.helper = this.instance.options._helper; } }); @@ -492,6 +492,7 @@ //by cloning the list group item, appending it to the sortable and using it as inst.currentItem //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one) this.instance.currentItem = $(self).clone().appendTo(this.instance.element).data("sortable-item", true); + this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it this.instance.options.helper = function() { return ui.helper[0]; }; e.target = this.instance.currentItem[0]; @@ -519,7 +520,7 @@ this.instance.cancelHelperRemoval = true; this.instance.options.revert = false; //No revert here this.instance.mouseStop(e, true); - this.instance.options.helper = "original"; + this.instance.options.helper = this.instance.options._helper; //Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size this.instance.currentItem.remove();