X-Git-Url: http://git.scottworley.com/vopamoi/blobdiff_plain/bc7996fe80c54f0a7a45e2153a27df466434938c..4e05a0a2a1072be98d271ac60de9426125e179e4:/vopamoi.ts?ds=sidebyside diff --git a/vopamoi.ts b/vopamoi.ts index fa55920..7497e54 100644 --- a/vopamoi.ts +++ b/vopamoi.ts @@ -144,10 +144,12 @@ const BrowserUI = { } }, - destroyTask: function () { - const createTimestamp = document.activeElement?.getAttribute("data-created"); - this.moveCursor(1) || this.moveCursor(-1); - return UI.destroyTask(createTimestamp!); + firstVisibleTask: function () { + for (const task of document.getElementsByClassName("task")) { + if (task instanceof HTMLElement && task.style.display !== "none") { + return task; + } + } }, focusTaskNameInput: function (event: Event) { @@ -236,4 +238,5 @@ function handleKey(event: any) { function browserInit() { document.body.addEventListener("keydown", handleKey, { capture: false }); log.replay(); + BrowserUI.firstVisibleTask()?.focus(); }