diff options
author | Mike Sherov <mike.sherov@gmail.com> | 2014-08-25 10:28:39 -0400 |
---|---|---|
committer | Mike Sherov <mike.sherov@gmail.com> | 2014-08-26 09:52:00 -0400 |
commit | 52a1de5caadd9dd0665d4bf092f6061d9d3a3a8e (patch) | |
tree | 8a4f7928a5f3a814892bd4780c873bcdb742b1bc /ui | |
parent | aada9d5ae7bfac64ff013931e26a73fd0284c921 (diff) | |
download | jquery-ui-52a1de5caadd9dd0665d4bf092f6061d9d3a3a8e.tar.gz jquery-ui-52a1de5caadd9dd0665d4bf092f6061d9d3a3a8e.zip |
Sortable: cancelHelperRemoval only considers helper, not placeholder
Refs #9675
Diffstat (limited to 'ui')
-rw-r--r-- | ui/sortable.js | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/ui/sortable.js b/ui/sortable.js index da4d13117..0207c8620 100644 --- a/ui/sortable.js +++ b/ui/sortable.js @@ -1253,18 +1253,6 @@ return $.widget("ui.sortable", $.ui.mouse, { } this.dragging = false; - if(this.cancelHelperRemoval) { - if(!noPropagation) { - this._trigger("beforeStop", event, this._uiHash()); - for (i=0; i < delayedTriggers.length; i++) { - delayedTriggers[i].call(this, event); - } //Trigger all delayed events - this._trigger("stop", event, this._uiHash()); - } - - this.fromOutside = false; - return false; - } if(!noPropagation) { this._trigger("beforeStop", event, this._uiHash()); @@ -1273,10 +1261,12 @@ return $.widget("ui.sortable", $.ui.mouse, { //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! this.placeholder[0].parentNode.removeChild(this.placeholder[0]); - if(this.helper[0] !== this.currentItem[0]) { - this.helper.remove(); + if ( !this.cancelHelperRemoval ) { + if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) { + this.helper.remove(); + } + this.helper = null; } - this.helper = null; if(!noPropagation) { for (i=0; i < delayedTriggers.length; i++) { @@ -1286,7 +1276,7 @@ return $.widget("ui.sortable", $.ui.mouse, { } this.fromOutside = false; - return true; + return !this.cancelHelperRemoval; }, |