summaryrefslogtreecommitdiff
path: root/src/ws
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2020-06-13 15:51:28 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2020-06-13 15:51:28 +0200
commitb56b8a450c2b0a70945998a3f8d7e9b0a71872a6 (patch)
tree3ab8b6f9f325e2a99219f13cb894fa0178331998 /src/ws
parent7c1295bf5dc8f72f4e0e43af72fe67847faadf6f (diff)
Add different background colors to better distinguish between group nodes and leaf nodes
Diffstat (limited to 'src/ws')
-rw-r--r--src/ws/node.js18
1 files changed, 18 insertions, 0 deletions
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()