Browse Source

#1046: fixed removing clone

pull/257/merge
Lebedev Konstantin 8 years ago
parent
commit
f485742d26
  1. 9
      Sortable.js

9
Sortable.js

@ -889,6 +889,11 @@
ghostEl && ghostEl.parentNode.removeChild(ghostEl); ghostEl && ghostEl.parentNode.removeChild(ghostEl);
if (rootEl === parentEl || Sortable.active.lastPullMode !== 'clone') {
// Remove clone
cloneEl && cloneEl.parentNode.removeChild(cloneEl);
}
if (dragEl) { if (dragEl) {
if (this.nativeDraggable) { if (this.nativeDraggable) {
_off(dragEl, 'dragend', this); _off(dragEl, 'dragend', this);
@ -905,7 +910,6 @@
newIndex = _index(dragEl, options.draggable); newIndex = _index(dragEl, options.draggable);
if (newIndex >= 0) { if (newIndex >= 0) {
// Add event // Add event
_dispatchEvent(null, parentEl, 'add', dragEl, rootEl, oldIndex, newIndex); _dispatchEvent(null, parentEl, 'add', dragEl, rootEl, oldIndex, newIndex);
@ -918,9 +922,6 @@
} }
} }
else { else {
// Remove clone
cloneEl && cloneEl.parentNode.removeChild(cloneEl);
if (dragEl.nextSibling !== nextEl) { if (dragEl.nextSibling !== nextEl) {
// Get the index of the dragged element within its parent // Get the index of the dragged element within its parent
newIndex = _index(dragEl, options.draggable); newIndex = _index(dragEl, options.draggable);

Loading…
Cancel
Save