From ca0b5bfcbe823a7d10adb07494c3b53d7c4cd5ac Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sat, 17 Nov 2012 00:24:17 -0300 Subject: [PATCH] Undo of a deleted topic keep into account if the nodes are visible or not. --- mindplot/src/main/javascript/Topic.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mindplot/src/main/javascript/Topic.js b/mindplot/src/main/javascript/Topic.js index 5470a22d..b7e31ffd 100644 --- a/mindplot/src/main/javascript/Topic.js +++ b/mindplot/src/main/javascript/Topic.js @@ -888,7 +888,12 @@ mindplot.Topic = new Class({ _setRelationshipLinesVisibility:function (value) { this._relationships.each(function (relationship) { - relationship.setVisibility(value); + var sourceTopic = relationship.getSourceTopic(); + var targetTopic = relationship.getTargetTopic(); + + var targetParent = targetTopic.getModel().getParent(); + var sourceParent = sourceTopic.getModel().getParent(); + relationship.setVisibility(value && (targetParent == null || !targetParent.areChildrenShrunken()) && (sourceParent == null || !sourceParent.areChildrenShrunken())); }); }, @@ -1203,7 +1208,7 @@ mindplot.Topic = new Class({ var relationships = child.getRelationships(); result = result.concat(relationships); - if(!child.areChildrenShrunken()){ + if (!child.areChildrenShrunken()) { var innerChilds = this._flatten2DElements(child); result = result.concat(innerChilds); }