From dd55626317d191b6528fe1b8f1d8d267157df748 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Mon, 15 Jun 2020 20:49:22 +0200 Subject: Major overhaul of visuals. --- src/ws/node.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/ws/node.js') diff --git a/src/ws/node.js b/src/ws/node.js index 76ad7e3..4c63496 100644 --- a/src/ws/node.js +++ b/src/ws/node.js @@ -173,11 +173,6 @@ Node.prototype.create = function() this.id_element.appendChild(id_txt); this.data_element.appendChild(this.id_element); - this.title_element = document.createElement("div"); - this.title_element.setAttribute("class", "title"); - this.title_element.setAttribute("ondblclick", "editTitle(event)"); - this.data_element.appendChild(this.title_element); - var add_child_button = document.createElement("div"); add_child_button.name = "add_button"; add_child_button.setAttribute("onclick", "addChild(event)"); @@ -199,9 +194,14 @@ Node.prototype.create = function() this.state_element.setAttribute("onclick", "changeState(event)"); this.state_element.setAttribute("nodeid", this.id); this.state_element.setAttribute("class", "state"); - this.state_element.innerHTML = "todo"; + this.setAttribute("state", "todo"); this.data_element.appendChild(this.state_element); + this.title_element = document.createElement("div"); + this.title_element.setAttribute("class", "title"); + this.title_element.setAttribute("ondblclick", "editTitle(event)"); + this.data_element.appendChild(this.title_element); + this.description_element = document.createElement("div"); this.description_element.setAttribute("class", "description"); this.description_element.setAttribute("ondblclick", "editDescription(event)"); @@ -332,19 +332,19 @@ Node.prototype.setAttribute = function(name, value) this.state_element.appendChild(txt); if(value == "done") { - this.state_element.style.color = "green"; + this.state_element.style.backgroundColor = "#36b37e"; } else if(value == "in-progress") { - this.state_element.style.color = "yellow"; + this.state_element.style.backgroundColor = "#ffd351"; } else if(value == "blocked") { - this.state_element.style.color = "red"; + this.state_element.style.backgroundColor = "#da4343"; } else { - this.state_element.style.color = "black"; + this.state_element.style.backgroundColor = "#ebedf0"; } } }; -- cgit v1.2.3