From 90b584569b3eee447c5d7d8f6a0c4fa10c1e148f Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 11 Nov 2012 21:06:20 -0300 Subject: [PATCH] Fix children shrunken issue. --- mindplot/src/main/javascript/Topic.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/mindplot/src/main/javascript/Topic.js b/mindplot/src/main/javascript/Topic.js index ec70d2cb..5470a22d 100644 --- a/mindplot/src/main/javascript/Topic.js +++ b/mindplot/src/main/javascript/Topic.js @@ -627,7 +627,18 @@ mindplot.Topic = new Class({ var elements = this._flatten2DElements(this); var fade = new mindplot.util.FadeEffect(elements, !value); fade.addEvent('complete', function () { - }); + // Set focus on the parent node ... + if (value) { + this.setOnFocus(true); + } + + // Set focus in false for all the children ... + elements.forEach(function (elem) { + if (elem.setOnFocus) { + elem.setOnFocus(false); + } + }); + }.bind(this)); fade.start(); mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeShrinkEvent, model); @@ -1192,8 +1203,10 @@ mindplot.Topic = new Class({ var relationships = child.getRelationships(); result = result.concat(relationships); - var innerChilds = this._flatten2DElements(child); - result = result.concat(innerChilds); + if(!child.areChildrenShrunken()){ + var innerChilds = this._flatten2DElements(child); + result = result.concat(innerChilds); + } } return result; },