From c3c84002898163c3c6625a4fedcddf1434f8e448 Mon Sep 17 00:00:00 2001 From: Marwan Al Jubeh Date: Mon, 17 Oct 2011 19:14:54 +0300 Subject: [PATCH] Core, Draggable: Fixed #7800 - Draggable helper="clone" doesn't remove the dragged clone if original element is removed upon drop --- ui/jquery.ui.core.js | 2 +- ui/jquery.ui.draggable.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/jquery.ui.core.js b/ui/jquery.ui.core.js index 8bcc4c441..f0cf89ba7 100644 --- a/ui/jquery.ui.core.js +++ b/ui/jquery.ui.core.js @@ -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; } diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index 6475ebd61..92dd13c0d 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -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))) { -- 2.39.5