mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 15:23:44 +08:00
Merge pull request #567 from VladimirTechMan/master
When removing a child, set key "parent" to null, don't delete it
This commit is contained in:
commit
075431cc2d
@ -66,7 +66,7 @@ export abstract class Container extends Node {
|
||||
for (var i = 0; i < children.length; i++) {
|
||||
child = children[i];
|
||||
// reset parent to prevent many _setChildrenIndices calls
|
||||
delete child.parent;
|
||||
child.parent = null;
|
||||
child.index = 0;
|
||||
child.remove();
|
||||
}
|
||||
@ -85,7 +85,7 @@ export abstract class Container extends Node {
|
||||
for (var i = 0; i < children.length; i++) {
|
||||
child = children[i];
|
||||
// reset parent to prevent many _setChildrenIndices calls
|
||||
delete child.parent;
|
||||
child.parent = null;
|
||||
child.index = 0;
|
||||
child.destroy();
|
||||
}
|
||||
|
@ -719,7 +719,7 @@ export abstract class Node {
|
||||
if (parent && parent.children) {
|
||||
parent.children.splice(this.index, 1);
|
||||
parent._setChildrenIndices();
|
||||
delete this.parent;
|
||||
this.parent = null;
|
||||
}
|
||||
|
||||
// every cached attr that is calculated via node tree
|
||||
|
Loading…
Reference in New Issue
Block a user