Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit cd09858

Browse files
fix(#287): toggle fullscreen with Escape
1 parent 3fcf04d commit cd09858

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

studio/src/app/pages/editor/app-editor/app-editor.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,6 @@ export class AppEditor {
430430
return;
431431
}
432432

433-
// Per default, when we switch to the fullscreen mode, we want to present the presentation not edit it
434-
this.presenting = !this.fullscreen;
435-
436433
await this.editorEventsHandler.selectDeck();
437434
await (deck as any).toggleFullScreen();
438435

@@ -442,20 +439,23 @@ export class AppEditor {
442439

443440
private initWindowResize() {
444441
if (window) {
445-
window.addEventListener('resize', debounce(async () => {
446-
this.fullscreen = isFullscreen();
447-
}, 300));
442+
window.addEventListener('resize', debounce(this.onWindowResize));
448443
}
449444
}
450445

451446
private removeWindowResize() {
452447
if (window) {
453-
window.removeEventListener('resize', debounce(async () => {
454-
this.fullscreen = isFullscreen();
455-
}, 300));
448+
window.removeEventListener('resize', debounce(this.onWindowResize));
456449
}
457450
}
458451

452+
private onWindowResize = () => {
453+
this.fullscreen = isFullscreen();
454+
455+
// Per default, when we switch to the fullscreen mode, we want to present the presentation not edit it
456+
this.presenting = this.fullscreen;
457+
};
458+
459459
@Listen('signIn', {target: 'document'})
460460
async signIn() {
461461
this.navService.navigate({

0 commit comments

Comments
 (0)