mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-20 15:06:15 -04:00
close About Snapdrop page on Escape Keydown
This commit is contained in:
parent
a7a91df558
commit
009fcd7745
1 changed files with 12 additions and 5 deletions
|
@ -228,11 +228,11 @@ class Dialog {
|
||||||
this.$el = $(id);
|
this.$el = $(id);
|
||||||
this.$el.querySelectorAll('[close]').forEach(el => el.addEventListener('click', e => this.hide()))
|
this.$el.querySelectorAll('[close]').forEach(el => el.addEventListener('click', e => this.hide()))
|
||||||
this.$el.querySelectorAll('[role="textbox"]').forEach((el) => {
|
this.$el.querySelectorAll('[role="textbox"]').forEach((el) => {
|
||||||
el.addEventListener("keydown", (e) => {
|
el.addEventListener("keydown", (e) => {
|
||||||
if (e.key === "Escape") {
|
if (e.key === "Escape") {
|
||||||
this.hide();
|
this.hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
this.$autoFocus = this.$el.querySelector('[autofocus]');
|
this.$autoFocus = this.$el.querySelector('[autofocus]');
|
||||||
}
|
}
|
||||||
|
@ -655,6 +655,13 @@ Events.on('load', () => {
|
||||||
animate();
|
animate();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// close About Snapdrop page on Escape
|
||||||
|
window.addEventListener("keydown", (e) => {
|
||||||
|
if (e.key === "Escape") {
|
||||||
|
window.location.hash = '#';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Notifications.PERMISSION_ERROR = `
|
Notifications.PERMISSION_ERROR = `
|
||||||
Notifications permission has been blocked
|
Notifications permission has been blocked
|
||||||
as the user has dismissed the permission prompt several times.
|
as the user has dismissed the permission prompt several times.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue