aboutsummaryrefslogtreecommitdiff
path: root/viewer/src
diff options
context:
space:
mode:
Diffstat (limited to 'viewer/src')
-rw-r--r--viewer/src/views/MainLayout.vue15
1 files changed, 15 insertions, 0 deletions
diff --git a/viewer/src/views/MainLayout.vue b/viewer/src/views/MainLayout.vue
index c09e99a..bcd2249 100644
--- a/viewer/src/views/MainLayout.vue
+++ b/viewer/src/views/MainLayout.vue
@@ -49,6 +49,11 @@ export default class MainLayout extends Vue {
49 mounted() { 49 mounted() {
50 history.replaceState({ ldgallery: "ENTRYPOINT" }, ""); 50 history.replaceState({ ldgallery: "ENTRYPOINT" }, "");
51 this.fetchGalleryItems(); 51 this.fetchGalleryItems();
52 document.body.addEventListener("fullscreenchange", this.onFullscreenChange);
53 }
54
55 destroyed() {
56 document.body.removeEventListener("fullscreenchange", this.onFullscreenChange);
52 } 57 }
53 58
54 @Watch("$route") 59 @Watch("$route")
@@ -77,6 +82,16 @@ export default class MainLayout extends Vue {
77 onAction: this.fetchGalleryItems, 82 onAction: this.fetchGalleryItems,
78 }); 83 });
79 } 84 }
85
86 @Watch("$uiStore.fullscreen")
87 applyFullscreen(fullscreen: boolean) {
88 if (fullscreen && !document.fullscreen) document.body.requestFullscreen();
89 else if (document.fullscreen) document.exitFullscreen();
90 }
91
92 onFullscreenChange() {
93 this.$uiStore.toggleFullscreen(document.fullscreen);
94 }
80} 95}
81</script> 96</script>
82 97