]> git.scottworley.com Git - vopamoi/blobdiff - vopamoi.ts
Tasks can be focused
[vopamoi] / vopamoi.ts
index cb2d50e5555676e16f95ec2d8b94db52bcb9a425..5967c7d909136eab3975fa042304f96d413105fe 100644 (file)
@@ -1,7 +1,19 @@
-var tasks = [];
+var tasks: string[] = [];
+
+function createViewTask(task: string) {
+  const viewTask = document.createElement("div");
+  viewTask.appendChild(document.createTextNode(task));
+  viewTask.setAttribute("tabindex", "0");
+  return viewTask;
+}
+
+function updateView() {
+  tasks.forEach((t) => document.getElementById(t) || document.body.appendChild(createViewTask(t)));
+}
 
 function addTask(task: string) {
   tasks.push(task);
+  updateView();
 }
 
 function browserCreateTask(form: any) {