From b56b8a450c2b0a70945998a3f8d7e9b0a71872a6 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sat, 13 Jun 2020 15:51:28 +0200 Subject: Add different background colors to better distinguish between group nodes and leaf nodes --- src/ws/node.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src') diff --git a/src/ws/node.js b/src/ws/node.js index d79137d..fa97368 100644 --- a/src/ws/node.js +++ b/src/ws/node.js @@ -106,6 +106,15 @@ Node.prototype.addChild = function(node, insertBeforeId) this.children.push(node); this.element.appendChild(node.element); } + + if(this.children.length == 0) + { + this.element.style.backgroundColor = "#aaa"; + } + else + { + this.element.style.backgroundColor = "#aaaa81"; + } }; Node.prototype.removeChild = function(node) @@ -116,6 +125,15 @@ Node.prototype.removeChild = function(node) }); node.parent = null; this.element.removeChild(node.element); + + if(this.children.length == 0) + { + this.element.style.backgroundColor = "#aaa"; + } + else + { + this.element.style.backgroundColor = "#aaaa81"; + } }; Node.prototype.create = function() -- cgit v1.2.3