Use hidden properly everywhere
All checks were successful
Build & Test / build-run (push) Successful in 45s

This commit is contained in:
CenTdemeern1 2025-02-12 21:59:35 +01:00
parent c1f61cfe9b
commit b408f66f9d
3 changed files with 5 additions and 7 deletions

View file

@ -146,9 +146,9 @@ export class InstanceDetailsDialog extends FormDialog {
#handleListEmpty() { #handleListEmpty() {
if (!this.defaultsList) return; if (!this.defaultsList) return;
if (this.defaultsList.list.children.length == 1) { if (this.defaultsList.list.children.length == 1) {
this.defaultsList.noDefaultsOption.removeAttribute("hidden"); this.defaultsList.noDefaultsOption.hidden = false;
} else { } else {
this.defaultsList.noDefaultsOption.setAttribute("hidden", ""); this.defaultsList.noDefaultsOption.hidden = true;
} }
} }

View file

@ -46,10 +46,8 @@ redirectAlwaysButton.addEventListener("click", e => {
}); });
function updateNoInstanceHint() { function updateNoInstanceHint() {
findParagraphOrFail(document.body, "#no-instance").style.display = findParagraphOrFail(document.body, "#no-instance").hidden =
storageManager.storage.instances.length > 0 storageManager.storage.instances.length > 0;
? "none"
: "";
} }
function createInstanceSelectOptions() { function createInstanceSelectOptions() {

View file

@ -2,7 +2,7 @@ export function resize(image: HTMLImageElement, width: number = 16, height: numb
const canvas = document.createElement('canvas'); const canvas = document.createElement('canvas');
canvas.width = width; canvas.width = width;
canvas.height = height; canvas.height = height;
canvas.style.display = "none"; canvas.hidden = true;
document.body.appendChild(canvas); document.body.appendChild(canvas);
const ctx = canvas.getContext("2d"); const ctx = canvas.getContext("2d");
if (ctx === null) throw Error("Resize failed"); if (ctx === null) throw Error("Resize failed");