Browse Source

* fixed animation

pull/126/merge
RubaXa 10 years ago
parent
commit
f2953597d7
  1. 13
      Sortable.js

13
Sortable.js

@ -380,9 +380,14 @@
return; 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); el.appendChild(dragEl);
this._animate(dragRect, dragEl); this._animate(dragRect, dragEl);
target && this._animate(targetRect, target);
} }
else if( target && !target.animated && target !== dragEl && (target.parentNode[expando] !== void 0) ){ else if( target && !target.animated && target !== dragEl && (target.parentNode[expando] !== void 0) ){
if( lastEl !== target ){ if( lastEl !== target ){
@ -413,12 +418,12 @@
if( after && !nextSibling ){ if( after && !nextSibling ){
el.appendChild(dragEl); el.appendChild(dragEl);
this._animate(dragRect, dragEl);
} else { } else {
target.parentNode.insertBefore(dragEl, after ? nextSibling : target); target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
this._animate(dragRect, dragEl);
this._animate(targetRect, target);
} }
this._animate(dragRect, dragEl);
this._animate(targetRect, target);
} }
} }
}, },

Loading…
Cancel
Save