mirror of
https://github.com/zen-browser/components.git
synced 2025-07-07 16:45:31 +02:00
Refactor ZenGlanceManager.mjs to handle opening and closing of glance with Escape key
This commit is contained in:
parent
ec38032192
commit
7112ae0f9e
1 changed files with 4 additions and 2 deletions
|
@ -17,7 +17,9 @@
|
||||||
() => document.getElementById('zen-glance-sidebar-container')
|
() => document.getElementById('zen-glance-sidebar-container')
|
||||||
);
|
);
|
||||||
|
|
||||||
window.addEventListener("unload", this.onUnload.bind(this));
|
document.getElementById('tabbrowser-tabpanels').addEventListener("click", this.onOverlayClick.bind(this));
|
||||||
|
|
||||||
|
window.addEventListener("beforeunload", this.onUnload.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
onKeyDown(event) {
|
onKeyDown(event) {
|
||||||
|
@ -29,7 +31,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
onOverlayClick(event) {
|
onOverlayClick(event) {
|
||||||
if (event.target === this.overlay || event.target === this.contentWrapper) {
|
if (event.target === this.overlay && event.originalTarget !== this.contentWrapper) {
|
||||||
this.closeGlance();
|
this.closeGlance();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue