From a5a661abca05beee43535636e41635ad5414170b Mon Sep 17 00:00:00 2001 From: Michael Hackstein Date: Tue, 23 Jul 2013 08:04:48 +0200 Subject: [PATCH] GraphViewer: CommunityNodes will now check if enough space is available and if there isn't expanded nodes will be colapsed again --- html/admin/js/graphViewer/graph/communityNode.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/html/admin/js/graphViewer/graph/communityNode.js b/html/admin/js/graphViewer/graph/communityNode.js index d07f19a27f..86b51a2c07 100644 --- a/html/admin/js/graphViewer/graph/communityNode.js +++ b/html/admin/js/graphViewer/graph/communityNode.js @@ -32,7 +32,9 @@ function CommunityNode(parent, initial) { "use strict"; - if (_.isUndefined(parent) || !_.isFunction(parent.dissolveCommunity)) { + if (_.isUndefined(parent) + || !_.isFunction(parent.dissolveCommunity) + || !_.isFunction(parent.checkNodeLimit)) { throw "A parent element has to be given."; } @@ -352,6 +354,7 @@ function CommunityNode(parent, initial) { colourFunc(inner); inner.on("click", function() { self.expand(); + parent.checkNodeLimit(self); start(); }); addCollapsedLabel(inner, colourMapper);