]>
Commit | Line | Data |
---|---|---|
7dcd9167 SW |
1 | var tasks: string[] = []; |
2 | ||
3 | function createViewTask(task: string) { | |
4 | const viewTask = document.createElement("div"); | |
5 | viewTask.appendChild(document.createTextNode(task)); | |
28568279 | 6 | viewTask.setAttribute("tabindex", "0"); |
7dcd9167 SW |
7 | return viewTask; |
8 | } | |
9 | ||
10 | function updateView() { | |
11 | tasks.forEach((t) => document.getElementById(t) || document.body.appendChild(createViewTask(t))); | |
12 | } | |
974848d3 SW |
13 | |
14 | function addTask(task: string) { | |
15 | tasks.push(task); | |
7dcd9167 | 16 | updateView(); |
974848d3 SW |
17 | } |
18 | ||
19 | function browserCreateTask(form: any) { | |
20 | addTask(form.taskName.value); | |
21 | form.taskName.value = ""; | |
22 | return false; | |
23 | } |