WebUI: Coding style fixes

This commit is contained in:
Stiliyan Tonev (Bark) 2025-06-28 14:08:35 +03:00
commit 5f527c2a6f
6 changed files with 8 additions and 3 deletions

View file

@ -19,6 +19,7 @@
break; break;
} }
}); });
document.getElementById("cancelBtn").focus(); document.getElementById("cancelBtn").focus();
document.getElementById("cancelBtn").addEventListener("click", (e) => { document.getElementById("cancelBtn").addEventListener("click", (e) => {
e.preventDefault(); e.preventDefault();

View file

@ -19,6 +19,7 @@
break; break;
} }
}); });
document.getElementById("cancelBtn").focus(); document.getElementById("cancelBtn").focus();
document.getElementById("cancelBtn").addEventListener("click", (e) => { document.getElementById("cancelBtn").addEventListener("click", (e) => {
e.preventDefault(); e.preventDefault();

View file

@ -19,6 +19,7 @@
break; break;
} }
}); });
document.getElementById("cancelBtn").focus(); document.getElementById("cancelBtn").focus();
document.getElementById("cancelBtn").addEventListener("click", (e) => { document.getElementById("cancelBtn").addEventListener("click", (e) => {
e.preventDefault(); e.preventDefault();

View file

@ -19,6 +19,7 @@
break; break;
} }
}); });
const searchParams = new URLSearchParams(window.location.search); const searchParams = new URLSearchParams(window.location.search);
const host = searchParams.get("host"); const host = searchParams.get("host");

View file

@ -22,6 +22,7 @@
break; break;
} }
}); });
const encodedUrls = new URLSearchParams(window.location.search).get("urls"); const encodedUrls = new URLSearchParams(window.location.search).get("urls");
if (encodedUrls !== null) { if (encodedUrls !== null) {
const urls = encodedUrls.split("|").map(decodeURIComponent); const urls = encodedUrls.split("|").map(decodeURIComponent);

View file

@ -1781,13 +1781,13 @@ window.addEventListener("DOMContentLoaded", (event) => {
const modalInstances = Object.values(MochaUI.Windows.instances); const modalInstances = Object.values(MochaUI.Windows.instances);
if (modalInstances.length <= 0) if (modalInstances.length <= 0)
return; return;
// MochaUI.currentModal does not update after a modal is closed // MochaUI.currentModal does not update after a modal is closed
const focusedModal = modalInstances.find((modal) => { const focusedModal = modalInstances.find((modal) => {
return modal.windowEl.hasClass("isFocused"); return modal.windowEl.hasClass("isFocused");
}); });
if (!focusedModal) if (focusedModal !== undefined)
return; focusedModal.close();
focusedModal.close();
break; break;
} }
} }