Added escape key for glance

This commit is contained in:
mr. M 2024-10-30 20:49:01 +01:00
parent 078e617cc8
commit 43be9a44c5
No known key found for this signature in database
GPG key ID: CBD57A2AEDBDA1FB

View file

@ -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();