summaryrefslogtreecommitdiff
path: root/src/ws/view.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/ws/view.js')
-rw-r--r--src/ws/view.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/ws/view.js b/src/ws/view.js
index 6c43dc8..aa4d9de 100644
--- a/src/ws/view.js
+++ b/src/ws/view.js
@@ -344,3 +344,32 @@ function collapse(e)
node.element.classList.remove('collapsed');
}
}
+
+function changeState(e)
+{
+ const idstr = e.target.parentElement.parentElement.id;
+ const node = findNodeFromString(idstr);
+ if(node == null)
+ {
+ return; // no node
+ }
+
+ const id = idFromStr(e.target.parentElement.parentElement.id);
+
+ switch(node.attributes["state"])
+ {
+ case "in-progress":
+ update(id, "state", "blocked");
+ break;
+ case "blocked":
+ update(id, "state", "done");
+ break;
+ case "done":
+ update(id, "state", "todo");
+ break;
+ default:
+ case "todo":
+ update(id, "state", "in-progress");
+ break;
+ }
+}