X-Git-Url: http://git.scottworley.com/vopamoi/blobdiff_plain/682139fcfed4fc2110ebef8a47953bb8655c8fba..8e91a18ee2db4b5595192f9772c5d375d4619efc:/vopamoi.ts diff --git a/vopamoi.ts b/vopamoi.ts index b16bc70..f93c51c 100644 --- a/vopamoi.ts +++ b/vopamoi.ts @@ -100,9 +100,6 @@ const Model = { const task = this.getTask(createTimestamp); if (task) { task.setAttribute("data-state", state); - if (task instanceof HTMLElement) { - task.style.display = state == "todo" ? "block" : "none"; // Until view filtering - } } }, }; @@ -225,7 +222,7 @@ const BrowserUI = { firstVisibleTask: function () { for (const task of document.getElementsByClassName("task")) { - if (task instanceof HTMLElement && task.style.display !== "none") { + if (task instanceof HTMLElement && task.getAttribute("data-state")! === "todo") { return task; } } @@ -243,7 +240,7 @@ const BrowserUI = { while (true) { cursor = increment > 0 ? cursor.nextElementSibling : cursor.previousElementSibling; if (!cursor || !(cursor instanceof HTMLElement)) break; - if (cursor.style.display !== "none") { + if (cursor.getAttribute("data-state")! === "todo") { offset -= increment; valid_cursor = cursor; } @@ -294,7 +291,7 @@ const BrowserUI = { setState: function (newState: string) { const task = document.activeElement; if (!task) return; - const oldState = task.getAttribute("data-state"); + const oldState = task.getAttribute("data-state")!; if (newState === oldState) return; const createTimestamp = task.getAttribute("data-created")!; this.moveCursor(1) || this.moveCursor(-1);