Skip to content

Commit

Permalink
Core, Draggable: Fixed #7800 - Draggable helper="clone" doesn't remov…
Browse files Browse the repository at this point in the history
…e the dragged clone if original element is removed upon drop
  • Loading branch information
maljub01 committed Oct 17, 2011
1 parent bdd602e commit c3c8400
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ui/jquery.ui.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ $.extend( $.ui, {
},
call: function( instance, name, args ) {
var set = instance.plugins[ name ];
if ( !set || !instance.element[ 0 ].parentNode ) {
if ( !set || !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion ui/jquery.ui.draggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ $.widget("ui.draggable", $.ui.mouse, {
}

//if the original element is removed, don't bother to continue
if(!this.element[0] || !this.element[0].parentNode)
if((!this.element[0] || !this.element[0].parentNode) && this.options.helper === "original")
return false;

if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
Expand Down

0 comments on commit c3c8400

Please sign in to comment.