Skip to content

Commit

Permalink
#547: * fixed parentEl actualization
Browse files Browse the repository at this point in the history
  • Loading branch information
RubaXa committed Sep 9, 2015
1 parent 2859b57 commit ac5e4a7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@

rootEl = el;
dragEl = target;
parentEl = target.parentNode;
parentEl = dragEl.parentNode;
nextEl = dragEl.nextSibling;
activeGroup = options.group;

Expand Down Expand Up @@ -609,11 +609,10 @@
) {

if (target) {
parentEl = target.parentNode; // actualization

if (target.animated) {
return;
}

targetRect = target.getBoundingClientRect();
}

Expand All @@ -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);
Expand Down Expand Up @@ -679,6 +678,8 @@
}
}

parentEl = dragEl.parentNode; // actualization

this._animate(dragRect, dragEl);
this._animate(targetRect, target);
}
Expand Down

0 comments on commit ac5e4a7

Please sign in to comment.