aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/views
diff options
context:
space:
mode:
authorOzoneGrif2020-04-28 03:40:25 +0200
committerGitHub2020-04-28 03:40:25 +0200
commit490668d2b3444b51804804c1ea1bb8fd571f525b (patch)
treeb6146a6c741be5779d007dace1604806238f8f68 /viewer/src/views
parent20fda5a867d9afb0a90eda78834c487df40abd05 (diff)
parentd41a885e32473935d03eb1b260061c89eef66b1e (diff)
downloadldgallery-490668d2b3444b51804804c1ea1bb8fd571f525b.tar.gz
Merge pull request #198 from pacien/oz-fullscreen
viewer: fullscreen on double-click is now true fullscreen. Also works…
Diffstat (limited to 'viewer/src/views')
-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