diff options
Diffstat (limited to 'proto.js')
-rw-r--r-- | proto.js | 20 |
1 files changed, 15 insertions, 5 deletions
@@ -172,8 +172,6 @@ try { var title = msg[2]; var description = msg[3]; var parent_id = msg[4]; -// var left = msg[4]; -// var top = msg[5]; var task = document.createElement("div"); task.name = "task"; @@ -187,8 +185,9 @@ try { task.id = "task_" + id; var taskText = document.createTextNode(title + ": " + description + " :" + task.id); - task.appendChild(taskText); - + taskText.id = "txt"; + task.appendChild(taskText); + // task.style.position = "absolute"; // task.style.left = left + "px"; // task.style.top = top + "px"; @@ -201,7 +200,7 @@ try { // dlButton.setAttribute("onclick", "deleteTask(" + id +")"); // task.appendChild(dlButton); - document.body.appendChild(task); +// document.body.appendChild(task); var parent_task = document.getElementById("task_" + parent_id); @@ -212,6 +211,16 @@ try { document.body.appendChild(task); } } + else if(cmd == "update") { + var id = msg[1]; + var title = msg[2]; + var description = msg[3]; + + var task = document.getElementById("task_" + id); + + var taskText = document.createTextNode(title + ": " + description + " :" + task.id); + task.appendChild(taskText); + } f++; // document.getElementById("box").style.top = i[3] + "px"; // document.getElementById("box").style.left = i[2] + "px"; @@ -282,6 +291,7 @@ function deleteTask(id) { function drag(target, e) { e.dataTransfer.setData('Text', target.id); + e.stopPropagation(); // <--- this fixes the drag target problem } function drop(target, e) { |