aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--viewer/public/index.html2
-rw-r--r--viewer/src/views/MainLayout.vue15
2 files changed, 16 insertions, 1 deletions
diff --git a/viewer/public/index.html b/viewer/public/index.html
index cadbc72..4b7e26d 100644
--- a/viewer/public/index.html
+++ b/viewer/public/index.html
@@ -24,7 +24,7 @@
24 <meta charset="utf-8"> 24 <meta charset="utf-8">
25 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 25 <meta http-equiv="X-UA-Compatible" content="IE=edge">
26 <meta name="mobile-web-app-capable" content="yes"> 26 <meta name="mobile-web-app-capable" content="yes">
27 <meta name="viewport" content="width=device-width,initial-scale=1.0"> 27 <meta name="viewport" content="user-scalable=no,width=device-width,initial-scale=1.0">
28 <meta name="generator" content="ldgallery"> 28 <meta name="generator" content="ldgallery">
29 29
30 <link rel="manifest" href="manifest.json"> 30 <link rel="manifest" href="manifest.json">
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