Fixed "calling remove() for dragging shape will throw an error". close #184

This commit is contained in:
Anton Lavrenov
2016-11-10 16:41:31 -06:00
parent 7b4e10fba8
commit 9b92331410
7 changed files with 100 additions and 18 deletions

View File

@@ -1156,7 +1156,9 @@
moveTo: function(newContainer) {
// do nothing if new container is already parent
if (this.getParent() !== newContainer) {
this.remove();
// this.remove my be overrided by drag and drop
// buy we need original
(this.__originalRemove || this.remove).call(this);
newContainer.add(this);
}
return this;