aboutsummaryrefslogtreecommitdiff
path: root/js/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/util.js')
-rw-r--r--js/util.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/js/util.js b/js/util.js
index a751497..4249acc 100644
--- a/js/util.js
+++ b/js/util.js
@@ -36,12 +36,12 @@ function dataBind(el, dataObject) {
}
}
for (let tag of el.querySelectorAll('[data-show]')) {
- let shouldShow = boolValue(tag.getAttribute('data-show'));
+ let shouldShow = boolValue(tag.getAttribute('data-show'));
tag.style.display = shouldShow ? '' : 'none';
}
for (let tag of el.querySelectorAll('[data-disabled]')) {
let isDisabled = boolValue(tag.getAttribute('data-disabled'));
-
+
if (isDisabled) {
tag.classList.add('disabled');
tag.setAttribute('disabled', 'disabled');
@@ -82,6 +82,10 @@ function showForm(selector, dataObject) {
show(selector);
}
+function move(arr, from, to) {
+ arr.splice(to, 0, arr.splice(from, 1)[0]);
+}
+
function hideForm(selector) {
hide('#cover');
hide(selector);