Skip to content

Commit

Permalink
issue SortableJS#1100: Fixed (in AngularJS) item reappearance when it…
Browse files Browse the repository at this point in the history
… is pulled from one list to another
  • Loading branch information
serjum committed Jul 10, 2017
1 parent daba1a8 commit d5572f6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@
fallbackClass: 'sortable-fallback',
fallbackOnBody: false,
fallbackTolerance: 0,
fallbackOffset: {x: 0, y: 0}
fallbackOffset: {x: 0, y: 0},
isAngular: false
};


Expand Down Expand Up @@ -872,6 +873,7 @@
},

_onDrop: function (/**Event*/evt) {
// debugger;
var el = this.el,
options = this.options;

Expand Down Expand Up @@ -921,6 +923,9 @@
newIndex = _index(dragEl, options.draggable);

if (newIndex >= 0) {
if (this.options.isAngular) {
dragEl.parentNode.removeChild(dragEl);
}
// Add event
_dispatchEvent(null, parentEl, 'add', dragEl, rootEl, oldIndex, newIndex);

Expand All @@ -934,6 +939,9 @@
}
else {
if (dragEl.nextSibling !== nextEl) {
if (this.options.isAngular) {
dragEl.parentNode.removeChild(dragEl);
}
// Get the index of the dragged element within its parent
newIndex = _index(dragEl, options.draggable);

Expand Down

0 comments on commit d5572f6

Please sign in to comment.