Files
HowBadIsMyBatch/docs/UIUtils.js
Frank Knoll a8ec099c00 refactoring
2024-07-14 02:11:41 +02:00

31 lines
655 B
JavaScript

class UIUtils {
static show(element) {
element.style.display = "block";
}
static hide(element) {
element.style.display = "none";
}
static disableButton(button) {
button.disabled = true;
}
static enableButton(button) {
button.disabled = false;
}
static instantiateTemplate(templateId) {
return document.getElementById(templateId).content.firstElementChild.cloneNode(true);
}
static clear(container) {
container.replaceChildren();
}
static getSelectedOption(selectElement) {
return selectElement.options[selectElement.selectedIndex];
}
}