close About Snapdrop page on Escape Keydown

This commit is contained in:
schlagmichdoch 2022-12-30 17:09:15 +01:00
parent a7a91df558
commit 009fcd7745

View file

@ -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.