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;
}
});
document.getElementById("cancelBtn").focus();
document.getElementById("cancelBtn").addEventListener("click", (e) => {
e.preventDefault();

View file

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

View file

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

View file

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

View file

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

View file

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