Skip to content

Commit 4234052

Browse files
authored
update index after remove node (#554)
1 parent 9eb2e7d commit 4234052

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/jsmind.mind.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,9 @@ export class Mind {
219219
}
220220
// clean all children
221221
children.length = 0;
222+
var node_parent = node.parent;
222223
// remove from parent's children
223-
var sibling = node.parent.children;
224+
var sibling = node_parent.children;
224225
var si = sibling.length;
225226
while (si--) {
226227
if (sibling[si].id == node.id) {
@@ -236,7 +237,7 @@ export class Mind {
236237
}
237238
// remove it's self
238239
node = null;
239-
//delete node;
240+
this._update_index(node_parent);
240241
return true;
241242
}
242243
_put_node(node) {

0 commit comments

Comments
 (0)