From 4d788baec8f2f3c74bd5ebf4fa6bfdedb60ff455 Mon Sep 17 00:00:00 2001 From: RubaXa Date: Thu, 3 Sep 2015 18:15:54 +0300 Subject: [PATCH] #500: fixed clone --- Sortable.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sortable.js b/Sortable.js index 706abae..d117906 100644 --- a/Sortable.js +++ b/Sortable.js @@ -585,7 +585,6 @@ target = _closest(evt.target, options.draggable, el); dragRect = dragEl.getBoundingClientRect(); - parentEl = target && target.parentNode || parentEl; // actualization if (revert) { _cloneHide(true); @@ -604,7 +603,10 @@ if ((el.children.length === 0) || (el.children[0] === ghostEl) || (el === evt.target) && (target = _ghostIsLast(el, evt)) ) { + if (target) { + parentEl = target.parentNode; // actualization + if (target.animated) { return; } @@ -622,6 +624,8 @@ } } else if (target && !target.animated && target !== dragEl && (target.parentNode[expando] !== void 0)) { + parentEl = target.parentNode; // actualization + if (lastEl !== target) { lastEl = target; lastCSS = _css(target);