X-Git-Url: http://git.scottworley.com/vopamoi/blobdiff_plain/7dcd916735fa4df2d8c27ccef144be0081bbe737..9e79bdbb90ffcb5929f76a4fb6860ed6396ac9de:/vopamoi.ts?ds=inline diff --git a/vopamoi.ts b/vopamoi.ts index 0d2944c..cfa1186 100644 --- a/vopamoi.ts +++ b/vopamoi.ts @@ -1,18 +1,12 @@ -var tasks: string[] = []; - -function createViewTask(task: string) { - const viewTask = document.createElement("div"); - viewTask.appendChild(document.createTextNode(task)); - return viewTask; -} - -function updateView() { - tasks.forEach((t) => document.getElementById(t) || document.body.appendChild(createViewTask(t))); +function createTask(description: string) { + const task = document.createElement("div"); + task.appendChild(document.createTextNode(description)); + task.setAttribute("tabindex", "0"); + return task; } -function addTask(task: string) { - tasks.push(task); - updateView(); +function addTask(description: string) { + document.body.appendChild(createTask(description)); } function browserCreateTask(form: any) {