diff options
author | Nick Colletti <gnomish@gmail.com> | 2020-01-21 11:55:30 -0500 |
---|---|---|
committer | Nick Colletti <gnomish@gmail.com> | 2020-01-21 11:55:30 -0500 |
commit | 2294b97365f343f3dd5f36f2a6632b5bca31d148 (patch) | |
tree | 8e5a007c1a37c37ee156a0bacf974eeeebc340b6 /js/util.js | |
parent | 5a52a13850607443d8f76ecad92e498a66d13166 (diff) |
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); |