diff options
Diffstat (limited to 'viewer/src')
-rw-r--r-- | viewer/src/views/MainLayout.vue | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/viewer/src/views/MainLayout.vue b/viewer/src/views/MainLayout.vue index 13b17b4..eee813f 100644 --- a/viewer/src/views/MainLayout.vue +++ b/viewer/src/views/MainLayout.vue | |||
@@ -95,14 +95,19 @@ export default class MainLayout extends Vue { | |||
95 | }); | 95 | }); |
96 | } | 96 | } |
97 | 97 | ||
98 | isFullscreenActive(): boolean { | ||
99 | return Boolean(document.fullscreenElement); | ||
100 | } | ||
101 | |||
98 | @Watch("$uiStore.fullscreen") | 102 | @Watch("$uiStore.fullscreen") |
99 | applyFullscreen(fullscreen: boolean) { | 103 | applyFullscreen(fullscreen: boolean) { |
100 | if (fullscreen && !document.fullscreen) document.body.requestFullscreen(); | 104 | const isFullscreenActive = this.isFullscreenActive(); |
101 | else if (document.fullscreen) document.exitFullscreen(); | 105 | if (fullscreen && !isFullscreenActive) document.body.requestFullscreen(); |
106 | else if (isFullscreenActive) document.exitFullscreen(); | ||
102 | } | 107 | } |
103 | 108 | ||
104 | onFullscreenChange() { | 109 | onFullscreenChange() { |
105 | this.$uiStore.toggleFullscreen(document.fullscreen); | 110 | this.$uiStore.toggleFullscreen(this.isFullscreenActive()); |
106 | } | 111 | } |
107 | } | 112 | } |
108 | </script> | 113 | </script> |