mirror of
https://github.com/konvajs/konva.git
synced 2025-10-15 12:34:52 +08:00
fix bug 169 when removing a node, be sure to also remove the drag and drop reference
This commit is contained in:
@@ -145,6 +145,7 @@
|
||||
this.off('mousedown.kinetic');
|
||||
this.off('touchstart.kinetic');
|
||||
};
|
||||
|
||||
/**
|
||||
* get draggable. Alias of getDraggable()
|
||||
* @name isDraggable
|
||||
|
@@ -167,6 +167,12 @@
|
||||
parent.children.splice(this.index, 1);
|
||||
parent._setChildrenIndices();
|
||||
|
||||
// remove from DD
|
||||
var dd = Kinetic.DD;
|
||||
if(dd && dd.node && dd.node._id === this._id) {
|
||||
delete Kinetic.DD.node;
|
||||
}
|
||||
|
||||
// remove children
|
||||
while(this.children && this.children.length > 0) {
|
||||
this.children[0].remove();
|
||||
|
Reference in New Issue
Block a user