summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--proto.js24
1 files changed, 21 insertions, 3 deletions
diff --git a/proto.js b/proto.js
index 5c7a1d5..b8873fe 100644
--- a/proto.js
+++ b/proto.js
@@ -183,6 +183,7 @@ try {
task.name = "task";
task.setAttribute("class", "task");
task.setAttribute("ondblclick", "editTitle(this, event)");
+ task.setAttribute("onclick", "showHideChildren(this, event)");
task.setAttribute("ondrop", "drop(this, event)");
task.setAttribute("ondragover", "return false");
task.setAttribute("draggable", true);
@@ -254,6 +255,23 @@ function drop(target, e) {
socket_task.send("move " + idFromStr(id) + " " + idFromStr(target.id) + ";");
}
+function showHideChildren(target, e)
+{
+ e.stopPropagation();
+ updateid = idFromStr(target.id);
+ if(target.style.backgroundColor != "red") {
+ target.style.backgroundColor = "red";
+ for(var i = 1; i < target.childNodes.length; i++) {
+ target.childNodes[i].style.display = "none";
+ }
+ } else {
+ target.style.backgroundColor = "grey";
+ for(var i = 1; i < target.childNodes.length; i++) {
+ target.childNodes[i].style.display = "block";
+ }
+ }
+}
+
//
// Butt ugly.. but hey! it works...
//
@@ -285,8 +303,8 @@ function onLostFocusHandler(target, e)
function editTitle(target, e)
{
e.stopPropagation();
- updateid = idFromStr(target.id)
- if(updateid < 10) return;
+ updateid = idFromStr(target.id);
+ if(updateid < 10) return;
var inp = document.createElement("input");
var txtdiv = document.getElementById(target.id + "_txt");
divtxt = txtdiv;
@@ -300,4 +318,4 @@ function editTitle(target, e)
lineedit = inp;
txtdiv.appendChild(inp);
inp.focus();
-} \ No newline at end of file
+}