From cd09858461cb5a119df79992e0125021a3cf4fa8 Mon Sep 17 00:00:00 2001 From: peterpeterparker Date: Mon, 2 Sep 2019 20:26:19 +0200 Subject: [PATCH] fix(#287): toggle fullscreen with Escape --- .../app/pages/editor/app-editor/app-editor.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/studio/src/app/pages/editor/app-editor/app-editor.tsx b/studio/src/app/pages/editor/app-editor/app-editor.tsx index 19a3610f1..e592ba33e 100644 --- a/studio/src/app/pages/editor/app-editor/app-editor.tsx +++ b/studio/src/app/pages/editor/app-editor/app-editor.tsx @@ -430,9 +430,6 @@ export class AppEditor { return; } - // Per default, when we switch to the fullscreen mode, we want to present the presentation not edit it - this.presenting = !this.fullscreen; - await this.editorEventsHandler.selectDeck(); await (deck as any).toggleFullScreen(); @@ -442,20 +439,23 @@ export class AppEditor { private initWindowResize() { if (window) { - window.addEventListener('resize', debounce(async () => { - this.fullscreen = isFullscreen(); - }, 300)); + window.addEventListener('resize', debounce(this.onWindowResize)); } } private removeWindowResize() { if (window) { - window.removeEventListener('resize', debounce(async () => { - this.fullscreen = isFullscreen(); - }, 300)); + window.removeEventListener('resize', debounce(this.onWindowResize)); } } + private onWindowResize = () => { + this.fullscreen = isFullscreen(); + + // Per default, when we switch to the fullscreen mode, we want to present the presentation not edit it + this.presenting = this.fullscreen; + }; + @Listen('signIn', {target: 'document'}) async signIn() { this.navService.navigate({