added fancy switches and updated the ui of the settings tab

This commit is contained in:
Malcolm Diller
2022-11-17 17:58:09 -08:00
parent 6756fb4fe7
commit 507491fbec
8 changed files with 158 additions and 33 deletions

View File

@ -358,3 +358,19 @@ function preventNonNumericalInput(e) {
e.preventDefault();
}
}
/* inserts custom html to allow prettifying of inputs */
function prettifyInputs(root_element) {
root_element.querySelectorAll(`input[type="checkbox"]`).forEach(element => {
var parent = element.parentNode;
if (!parent.classList.contains("input-toggle")) {
var wrapper = document.createElement("div");
wrapper.classList.add("input-toggle");
parent.replaceChild(wrapper, element);
wrapper.appendChild(element);
var label = document.createElement("label");
label.htmlFor = element.id;
wrapper.appendChild(label);
}
})
}