diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-05-10 12:28:58 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2022-05-10 12:28:58 -0700 |
commit | 99e7a11c25e704851cfbbaed64594acbbd752038 (patch) | |
tree | 0036ad0032c48344df2b6e258e5ab39d91ab3694 /web/static/dartboat.js | |
parent | 07dd14baa1dbe71d6f81eca16c2762c38470eef8 (diff) | |
download | dartboat-99e7a11c25e704851cfbbaed64594acbbd752038.tar.gz dartboat-99e7a11c25e704851cfbbaed64594acbbd752038.tar.xz |
web: ui improvements, mainly for mobile
Using a `100vh' height results in the bottom bit of the UI being cropped
until scrolling down, while using `100%' results in the address bar
always wasting space. By combining these with a fixed-position element,
we're able to have the UI grow and shrink as the address bar visibility
changes.
Diffstat (limited to 'web/static/dartboat.js')
-rw-r--r-- | web/static/dartboat.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/web/static/dartboat.js b/web/static/dartboat.js index e664a8d..aacb1bc 100644 --- a/web/static/dartboat.js +++ b/web/static/dartboat.js @@ -158,8 +158,9 @@ document.addEventListener('DOMContentLoaded', () => { f = e => $(`#${e.target.dataset.modal}`).style.display = 'block'; $$('[data-modal]').forEach(x => x.addEventListener('click', f)); f = e => { - if (e.target === e.currentTarget) - e.target.style.display = 'none'; + if (e.target === e.currentTarget || + e.target.classList.contains("modal-close")) + e.currentTarget.style.display = 'none'; }; $$('.modal').forEach(x => x.addEventListener('click', f)); }); |