Fix delete relationship issue.

This commit is contained in:
Paulo Gustavo Veiga 2012-07-13 21:27:52 -03:00
parent 39e4f18a48
commit 690c359ce2

View File

@ -638,20 +638,23 @@ mindplot.Designer = new Class({
}, },
_addRelationship:function (model) { _addRelationship:function (model) {
this._mindmap.addRelationship(model); var mindmap = this.getMindmap();
mindmap.addRelationship(model);
return this._relationshipModelToRelationship(model); return this._relationshipModelToRelationship(model);
}, },
_deleteRelationship:function (relationship) { _deleteRelationship:function (rel) {
var sourceTopic = relationship.getSourceTopic(); var sourceTopic = rel.getSourceTopic();
sourceTopic.deleteRelationship(relationship); sourceTopic.deleteRelationship(rel);
var targetTopic = relationship.getTargetTopic(); var targetTopic = rel.getTargetTopic();
targetTopic.deleteRelationship(relationship); targetTopic.deleteRelationship(rel);
this._workspace.removeChild(relationship); this.getModel().removeRelationship(rel);
this._workspace.removeChild(rel);
this.getModel().removeRelationship(relationship); var mindmap = this.getMindmap();
mindmap.deleteRelationship(rel.getModel());
}, },
_buildRelationshipShape:function (model) { _buildRelationshipShape:function (model) {