Merge pull request #501 from maljub01/master

Fixed ticket #7800 - Draggable helper="clone" doesn't remove the dragged clone if original element is removed upon drop
This commit is contained in:
Scott González 2011-11-17 07:31:03 -08:00
commit 69f6f585ae
2 changed files with 2 additions and 2 deletions

View File

@ -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;
}

View File

@ -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))) {