diff options
Diffstat (limited to 'task.js')
-rw-r--r-- | task.js | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -1,6 +1,16 @@ /* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set et sw=2 ts=2: */ +function createId(boardid, taskid) +{ + return "b" + boardid + "_t" + taskid; +} + +function idFromStr(str) +{ + return str.substring(str.search('t') + 1, str.length); +} + var tasks = new Array(); function findTask(id, observeid) @@ -79,8 +89,11 @@ Task.prototype.create = function() task.setAttribute("draggable", true); task.setAttribute("ondragstart", "drag(this, event)"); task.setAttribute("title", this.id); - + + // This is a hack to make it possible to identify the taskid and + // oberveid from the node id alone. task.id = createId(this.observeid, this.id); + /* var observe_button = document.createElement("div"); observe_button.name = "observe_button"; @@ -100,6 +113,7 @@ Task.prototype.create = function() unobserve_button.appendChild(txt_minus); task.appendChild(unobserve_button); */ + this.element.appendChild(this.div_id); var id_txt = document.createTextNode(this.id); this.div_id.appendChild(id_txt); |