diff options
| author | 2021-10-21 11:33:35 +0200 | |
|---|---|---|
| committer | 2021-10-21 11:33:35 +0200 | |
| commit | cfd625c5596f2ce20ab4341bb04ddb263552e417 (patch) | |
| tree | 4bf0ae9292bda5b26e65423c0b49fe2998bfd5e6 /p/scripts | |
| parent | 401af448ccde9246b51e041e89435faf8b463051 (diff) | |
close panel with esc shortcut (#3901)
* ESC as shortcut to close
* some little beauty
* only ESC close the list now
* Update template.rtl.css
* fixed onclick listener
* Update global_view.js
* heebie jeebies fix ;-)
* Update p/scripts/global_view.js
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'p/scripts')
| -rw-r--r-- | p/scripts/global_view.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/p/scripts/global_view.js b/p/scripts/global_view.js index bc4a48b91..e9515be6a 100644 --- a/p/scripts/global_view.js +++ b/p/scripts/global_view.js @@ -73,6 +73,13 @@ function init_close_panel() { document.getElementById('overlay').classList.remove('visible'); return false; }; + document.addEventListener('keydown', ev => { + const k = (ev.key.trim() || ev.code).toUpperCase(); + if (k === 'ESCAPE' || k === 'ESC') { + document.querySelector('#overlay .close').click(); + } + return false; + }); } function init_global_view() { |
