From f2953597d77b44c0e36cef7cc1ca725d76c2bab7 Mon Sep 17 00:00:00 2001 From: RubaXa Date: Sun, 9 Nov 2014 02:32:37 +0300 Subject: [PATCH] * fixed animation --- Sortable.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Sortable.js b/Sortable.js index 09a210f..b38ad89 100644 --- a/Sortable.js +++ b/Sortable.js @@ -380,9 +380,14 @@ return; } - if( el.children.length === 0 || el.children[0] === ghostEl || (el === evt.target) && _ghostInBottom(el, evt) ){ + if( (el.children.length === 0) || (el.children[0] === ghostEl) || + (el === evt.target) && _ghostInBottom(el, evt) + ){ + target && (targetRect = target.getBoundingClientRect()); + el.appendChild(dragEl); this._animate(dragRect, dragEl); + target && this._animate(targetRect, target); } else if( target && !target.animated && target !== dragEl && (target.parentNode[expando] !== void 0) ){ if( lastEl !== target ){ @@ -413,12 +418,12 @@ if( after && !nextSibling ){ el.appendChild(dragEl); - this._animate(dragRect, dragEl); } else { target.parentNode.insertBefore(dragEl, after ? nextSibling : target); - this._animate(dragRect, dragEl); - this._animate(targetRect, target); } + + this._animate(dragRect, dragEl); + this._animate(targetRect, target); } } },