aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/views/MainLayout.vue
diff options
context:
space:
mode:
authorZero~Informatique2020-04-28 03:27:01 +0200
committerZero~Informatique2020-04-28 03:28:38 +0200
commitd41a885e32473935d03eb1b260061c89eef66b1e (patch)
treeb6146a6c741be5779d007dace1604806238f8f68 /viewer/src/views/MainLayout.vue
parent20fda5a867d9afb0a90eda78834c487df40abd05 (diff)
downloadldgallery-d41a885e32473935d03eb1b260061c89eef66b1e.tar.gz
viewer: fullscreen on double-click is now true fullscreen. Also works on web-app
Diffstat (limited to 'viewer/src/views/MainLayout.vue')
-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