mirror of
https://github.com/zen-browser/components.git
synced 2025-07-07 16:35:30 +02:00
Added escape key for glance
This commit is contained in:
parent
078e617cc8
commit
43be9a44c5
1 changed files with 8 additions and 0 deletions
|
@ -40,6 +40,8 @@
|
|||
|
||||
this.originalOverlayParent = this.overlay.parentNode;
|
||||
|
||||
window.addEventListener("keydown", this.onKeyDown.bind(this));
|
||||
|
||||
Services.obs.addObserver(this, "zen-glance-open");
|
||||
this.initProgressListener();
|
||||
}
|
||||
|
@ -62,6 +64,12 @@
|
|||
};
|
||||
}
|
||||
|
||||
onKeyDown(event) {
|
||||
if (event.key === "Escape") {
|
||||
this.closeGlance();
|
||||
}
|
||||
}
|
||||
|
||||
onOverlayClick(event) {
|
||||
if (event.target === this.overlay || event.target === this.contentWrapper) {
|
||||
this.closeGlance();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue