Fix 'element could not be removed:[object Object] fixed.

This commit is contained in:
Paulo Gustavo Veiga 2012-11-14 23:46:28 -03:00
parent 2c5f7139d5
commit 7ba21f85bf

View File

@ -115,14 +115,16 @@ mindplot.DragTopic = new Class({
},
removeFromWorkspace:function (workspace) {
if (this._isInWorkspace) {
// Remove drag shadow.
workspace.removeChild(this._elem2d);
this._isInWorkspace = false;
// Remove pivot shape. To improve performace it will not be removed. Only the visibility will be changed.
// Remove pivot shape. To improve performance it will not be removed. Only the visibility will be changed.
var dragPivot = this._getDragPivot();
dragPivot.setVisibility(false);
this._isInWorkspace = false;
}
},
isInWorkspace:function () {
@ -130,10 +132,12 @@ mindplot.DragTopic = new Class({
},
addToWorkspace:function (workspace) {
if (!this._isInWorkspace) {
workspace.appendChild(this._elem2d);
var dragPivot = this._getDragPivot();
dragPivot.addToWorkspace(workspace);
this._isInWorkspace = true;
}
},
_getDragPivot:function () {