diff --git a/public/scripts/ui.js b/public/scripts/ui.js index c6b15a1..4c171c0 100644 --- a/public/scripts/ui.js +++ b/public/scripts/ui.js @@ -228,11 +228,11 @@ class Dialog { this.$el = $(id); this.$el.querySelectorAll('[close]').forEach(el => el.addEventListener('click', e => this.hide())) this.$el.querySelectorAll('[role="textbox"]').forEach((el) => { - el.addEventListener("keydown", (e) => { - if (e.key === "Escape") { - this.hide(); - } - }); + el.addEventListener("keydown", (e) => { + if (e.key === "Escape") { + this.hide(); + } + }); }) this.$autoFocus = this.$el.querySelector('[autofocus]'); } @@ -655,6 +655,13 @@ Events.on('load', () => { animate(); }); +// close About Snapdrop page on Escape +window.addEventListener("keydown", (e) => { + if (e.key === "Escape") { + window.location.hash = '#'; + } +}); + Notifications.PERMISSION_ERROR = ` Notifications permission has been blocked as the user has dismissed the permission prompt several times.