fix bug 169 when removing a node, be sure to also remove the drag and drop reference

This commit is contained in:
Eric Rowell
2012-12-13 00:01:24 -08:00
parent 3fb9576672
commit 5e16b3d7d0
3 changed files with 47 additions and 0 deletions

View File

@@ -145,6 +145,7 @@
this.off('mousedown.kinetic');
this.off('touchstart.kinetic');
};
/**
* get draggable. Alias of getDraggable()
* @name isDraggable

View File

@@ -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();