<head>
<script src="vopamoi.js" defer="true"></script>
<link rel="stylesheet" href="vopamoi.css"/>
+ <style id="viewStyle">.task:not([data-state=todo]) { display: none }</style>
</head>
<body onload="browserInit();">
<input id="taskName" name="taskName">
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
- }
}
},
};
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;
}
}
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;
}
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);