]> git.scottworley.com Git - vopamoi/commitdiff
"c" to "Create" tasks
authorScott Worley <scottworley@scottworley.com>
Tue, 25 Jan 2022 22:29:23 +0000 (14:29 -0800)
committerScott Worley <scottworley@scottworley.com>
Thu, 27 Jan 2022 20:21:09 +0000 (12:21 -0800)
index.html
vopamoi.ts

index 5ed2498f3bb48f3fc5c43e69de271cd9305a6864..afb92310049b85518a932ca2895a59acd573135f 100644 (file)
@@ -5,7 +5,7 @@
   </head>
   <body onload="browserInit();">
     <form onsubmit="return browserCreateTask(this);">
-      <input name="taskName">
+      <input id="taskName" name="taskName">
     </form>
   </body>
 </html>
index 2567e85e79ec5799bdb9b851a213b4a51f2d5bfc..8db28657eaddcdfb56a3ed15797bdacf5c65aba2 100644 (file)
@@ -26,6 +26,10 @@ function handleKey(event: any) {
   if (event.target.tagName !== "INPUT") {
     if (event.key == "j") Model.moveCursor(1);
     if (event.key == "k") Model.moveCursor(-1);
+    if (event.key == "c") {
+      document.getElementById("taskName")!.focus();
+      event.preventDefault();
+    }
   }
 }