diff --git a/Sortable.js b/Sortable.js index 9929acd..48ea322 100644 --- a/Sortable.js +++ b/Sortable.js @@ -830,31 +830,34 @@ } } - // Nulling - rootEl = - dragEl = - parentEl = - ghostEl = - nextEl = - cloneEl = + } + this._nulling(); + }, - scrollEl = - scrollParentEl = + _nulling: function() { + // Nulling + rootEl = + dragEl = + parentEl = + ghostEl = + nextEl = + cloneEl = - tapEvt = - touchEvt = + scrollEl = + scrollParentEl = - moved = - newIndex = + tapEvt = + touchEvt = - lastEl = - lastCSS = + moved = + newIndex = - activeGroup = - Sortable.active = null; - } - }, + lastEl = + lastCSS = + activeGroup = + Sortable.active = null; + }, handleEvent: function (/**Event*/evt) { var type = evt.type; diff --git a/ng-sortable.js b/ng-sortable.js index 6ed70cf..f1526b7 100644 --- a/ng-sortable.js +++ b/ng-sortable.js @@ -149,7 +149,7 @@ return opts; }, { onStart: function (/**Event*/evt) { - nextSibling = evt.item.nextSibling; + nextSibling = evt.from === evt.item.parentNode ? evt.item.nextSibling : evt.clone.nextSibling; _emitEvent(evt); scope.$apply(); },