settings-dns: expand custom servers box if it has custom servers

Signed-off-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
XhmikosR
2025-06-14 19:07:15 +03:00
parent 30ff1cd556
commit 65e2917b74
2 changed files with 11 additions and 1 deletions

View File

@@ -94,6 +94,16 @@ function fillDNSupstreams(value, servers) {
// Initialize textfield
updateDNSserversTextfield(value.value, customServers);
// Expand the box if there are custom servers
// Not using the AdminLTE API so that the expansion is not animated
// Otherwise, we could use `$(customBox).boxWidget("expand")`
if (customServers > 0) {
const customBox = document.getElementById("custom-servers-box");
customBox.classList.remove("collapsed-box");
customBox.querySelector(".btn-box-tool > i").classList.replace("fa-plus", "fa-minus");
customBox.querySelector(".box-body").style = "";
}
// Hide the loading animation
$("#dns-upstreams-overlay").hide();