From 12448fc6cb2d2a812593dbc254e92e503dc3d1cc Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 28 Nov 2012 22:09:29 -0300 Subject: [PATCH] Central node never can be collapsed. --- mindplot/src/main/javascript/Designer.js | 5 +++-- mindplot/src/main/javascript/Topic.js | 2 +- .../src/main/javascript/persistence/XMLSerializer_Pela.js | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mindplot/src/main/javascript/Designer.js b/mindplot/src/main/javascript/Designer.js index 456921e4..6909f527 100644 --- a/mindplot/src/main/javascript/Designer.js +++ b/mindplot/src/main/javascript/Designer.js @@ -440,8 +440,9 @@ mindplot.Designer = new Class({ } // Execute event ... var topic = nodes[0]; - this._actionDispatcher.shrinkBranch([topic.getId()], !topic.areChildrenShrunken()); - + if (topic.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { + this._actionDispatcher.shrinkBranch([topic.getId()], !topic.areChildrenShrunken()); + } }, createChildForSelectedNode:function () { diff --git a/mindplot/src/main/javascript/Topic.js b/mindplot/src/main/javascript/Topic.js index b7e31ffd..afd3c660 100644 --- a/mindplot/src/main/javascript/Topic.js +++ b/mindplot/src/main/javascript/Topic.js @@ -598,7 +598,7 @@ mindplot.Topic = new Class({ areChildrenShrunken:function () { var model = this.getModel(); - return model.areChildrenShrunken(); + return model.areChildrenShrunken() && !this.isCentralTopic(); }, isCollapsed:function () { diff --git a/mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js b/mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js index 95da6d9d..e2e22411 100644 --- a/mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js +++ b/mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js @@ -92,7 +92,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({ } - if (topic.areChildrenShrunken()) { + if (topic.areChildrenShrunken() && topic.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { parentTopic.setAttribute('shrink', 'true'); }