mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
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:
commit
69f6f585ae
2
ui/jquery.ui.core.js
vendored
2
ui/jquery.ui.core.js
vendored
@ -255,7 +255,7 @@ $.extend( $.ui, {
|
|||||||
},
|
},
|
||||||
call: function( instance, name, args ) {
|
call: function( instance, name, args ) {
|
||||||
var set = instance.plugins[ name ];
|
var set = instance.plugins[ name ];
|
||||||
if ( !set || !instance.element[ 0 ].parentNode ) {
|
if ( !set || !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
ui/jquery.ui.draggable.js
vendored
2
ui/jquery.ui.draggable.js
vendored
@ -208,7 +208,7 @@ $.widget("ui.draggable", $.ui.mouse, {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//if the original element is removed, don't bother to continue
|
//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;
|
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))) {
|
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))) {
|
||||||
|
Loading…
Reference in New Issue
Block a user