diff options
author | Einar Egilsson <einar@einaregilsson.com> | 2020-02-04 22:37:30 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-04 22:37:30 +0000 |
commit | 7a1c186b14fae578940f319a338f22b962316a41 (patch) | |
tree | d0fec15912e3a03e3487c7fe1e82840bb8c49b80 /js/util.js | |
parent | 5a52a13850607443d8f76ecad92e498a66d13166 (diff) | |
parent | e160789614b80a86133b820e1419c9457c5bf3e2 (diff) |
Merge pull request #184 from ncolletti/nav-btns
added move to First and Last buttons
Diffstat (limited to 'js/util.js')
-rw-r--r-- | js/util.js | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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); |