Skip to content

Commit

Permalink
update index after remove node (#554)
Browse files Browse the repository at this point in the history
  • Loading branch information
hizzgdev authored Dec 15, 2023
1 parent 9eb2e7d commit 4234052
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/jsmind.mind.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,9 @@ export class Mind {
}
// clean all children
children.length = 0;
var node_parent = node.parent;
// remove from parent's children
var sibling = node.parent.children;
var sibling = node_parent.children;
var si = sibling.length;
while (si--) {
if (sibling[si].id == node.id) {
Expand All @@ -236,7 +237,7 @@ export class Mind {
}
// remove it's self
node = null;
//delete node;
this._update_index(node_parent);
return true;
}
_put_node(node) {
Expand Down

0 comments on commit 4234052

Please sign in to comment.