diff options
author | Joris | 2022-08-21 14:32:34 +0200 |
---|---|---|
committer | Joris | 2022-08-21 15:02:34 +0200 |
commit | 337b2f5ef32ecace699d2225f31caf3257806b44 (patch) | |
tree | 98e77d6b0e7bd099227d5d0961893c7359c81105 /assets/main.js | |
parent | c276e97deabef70daff74bbccac60ff468b5f772 (diff) |
Fix payments page on narrow devices
After the introduction of filters, the payments table page was not very
usable on mobile phones.
Diffstat (limited to 'assets/main.js')
-rw-r--r-- | assets/main.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/assets/main.js b/assets/main.js index 1b5620f..4f72add 100644 --- a/assets/main.js +++ b/assets/main.js @@ -8,6 +8,7 @@ if (path == '/login') { } else if (path == '/') { // Payment table + show_hide_search() allow_select_reset() allow_date_reset() @@ -58,6 +59,16 @@ function trim_inputs_on_blur() { }) } +function show_hide_search() { + document.querySelector('.g-ShowSearch button').addEventListener('click', () => { + document.querySelector('.g-Aside').classList.add('g-Aside--Show') + }) + + document.querySelector('.g-Payments__CloseFilters').addEventListener('click', () => { + document.querySelector('.g-Aside').classList.remove('g-Aside--Show') + }) +} + function allow_select_reset() { document.querySelectorAll('select').forEach(select => { const canBeReset = Array.from(select.options).find(option => option.disabled) |