diff options
author | OzoneGrif | 2020-04-28 03:40:25 +0200 |
---|---|---|
committer | GitHub | 2020-04-28 03:40:25 +0200 |
commit | 490668d2b3444b51804804c1ea1bb8fd571f525b (patch) | |
tree | b6146a6c741be5779d007dace1604806238f8f68 /viewer | |
parent | 20fda5a867d9afb0a90eda78834c487df40abd05 (diff) | |
parent | d41a885e32473935d03eb1b260061c89eef66b1e (diff) | |
download | ldgallery-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')
-rw-r--r-- | viewer/public/index.html | 2 | ||||
-rw-r--r-- | viewer/src/views/MainLayout.vue | 15 |
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 | ||