From ac5e4a7f904214b100ff2ade97adc678fc7c722f Mon Sep 17 00:00:00 2001 From: RubaXa Date: Wed, 9 Sep 2015 09:28:47 +0300 Subject: [PATCH] #547: * fixed parentEl actualization --- Sortable.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Sortable.js b/Sortable.js index 3fb941a..17a3cc4 100644 --- a/Sortable.js +++ b/Sortable.js @@ -315,7 +315,7 @@ rootEl = el; dragEl = target; - parentEl = target.parentNode; + parentEl = dragEl.parentNode; nextEl = dragEl.nextSibling; activeGroup = options.group; @@ -609,11 +609,10 @@ ) { if (target) { - parentEl = target.parentNode; // actualization - if (target.animated) { return; } + targetRect = target.getBoundingClientRect(); } @@ -622,14 +621,14 @@ if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect) !== false) { if (!dragEl.contains(el)) { el.appendChild(dragEl); + parentEl = el; // actualization } + this._animate(dragRect, dragEl); target && this._animate(targetRect, target); } } else if (target && !target.animated && target !== dragEl && (target.parentNode[expando] !== void 0)) { - parentEl = target.parentNode; // actualization - if (lastEl !== target) { lastEl = target; lastCSS = _css(target); @@ -679,6 +678,8 @@ } } + parentEl = dragEl.parentNode; // actualization + this._animate(dragRect, dragEl); this._animate(targetRect, target); }