Merge branch 'beta' into mdiller_ui_reorganize

This commit is contained in:
Malcolm Diller
2022-11-08 21:22:22 -08:00
13 changed files with 772 additions and 214 deletions

View File

@ -30,9 +30,15 @@ function toggleCollapsible(element) {
collapsibleHeader.classList.toggle("active")
let content = getNextSibling(collapsibleHeader, '.collapsible-content')
if (!collapsibleHeader.classList.contains("active")) {
handle.innerHTML = '➕' // plus
content.style.display = "none"
if (handle != null) { // render results don't have a handle
handle.innerHTML = '➕' // plus
}
} else {
handle.innerHTML = '➖' // minus
content.style.display = "block"
if (handle != null) { // render results don't have a handle
handle.innerHTML = '➖' // minus
}
}
if (COLLAPSIBLES_INITIALIZED && COLLAPSIBLE_PANELS.includes(element)) {
@ -340,3 +346,15 @@ function asyncDelay(timeout) {
setTimeout(resolve, timeout, true)
})
}
function preventNonNumericalInput(e) {
e = e || window.event;
let charCode = (typeof e.which == "undefined") ? e.keyCode : e.which;
let charStr = String.fromCharCode(charCode);
let re = e.target.getAttribute('pattern') || '^[0-9]+$'
re = new RegExp(re)
if (!charStr.match(re)) {
e.preventDefault();
}
}