mirror of
https://github.com/zen-browser/components.git
synced 2025-07-07 20:59:59 +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;
|
this.originalOverlayParent = this.overlay.parentNode;
|
||||||
|
|
||||||
|
window.addEventListener("keydown", this.onKeyDown.bind(this));
|
||||||
|
|
||||||
Services.obs.addObserver(this, "zen-glance-open");
|
Services.obs.addObserver(this, "zen-glance-open");
|
||||||
this.initProgressListener();
|
this.initProgressListener();
|
||||||
}
|
}
|
||||||
|
@ -62,6 +64,12 @@
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onKeyDown(event) {
|
||||||
|
if (event.key === "Escape") {
|
||||||
|
this.closeGlance();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onOverlayClick(event) {
|
onOverlayClick(event) {
|
||||||
if (event.target === this.overlay || event.target === this.contentWrapper) {
|
if (event.target === this.overlay || event.target === this.contentWrapper) {
|
||||||
this.closeGlance();
|
this.closeGlance();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue