Skip to content

Commit

Permalink
valor-software#123: Distinguishing nodeRemoved and nodeMoved events
Browse files Browse the repository at this point in the history
  • Loading branch information
itserg committed Apr 10, 2018
1 parent d6414d5 commit 5e8f64c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tree-internal.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,13 @@ export class TreeInternalComponent implements OnInit, OnChanges, OnDestroy, Afte
}

private moveNodeToThisTreeAndRemoveFromPreviousOne(e: NodeDraggableEvent, tree: Tree): void {
this.treeService.fireNodeRemoved(e.captured.tree);
e.captured.tree.removeItselfFromParent();
const addedChild = tree.addChild(e.captured.tree);
this.treeService.fireNodeMoved(addedChild, e.captured.tree.parent);
}

private moveNodeToParentTreeAndRemoveFromPreviousOne(e: NodeDraggableEvent, tree: Tree): void {
this.treeService.fireNodeRemoved(e.captured.tree);
e.captured.tree.removeItselfFromParent();
const addedSibling = tree.addSibling(e.captured.tree, tree.positionInParent);
this.treeService.fireNodeMoved(addedSibling, e.captured.tree.parent);
}
Expand Down

0 comments on commit 5e8f64c

Please sign in to comment.