diff options
author | Zero~Informatique | 2020-02-12 00:09:34 +0100 |
---|---|---|
committer | Zero~Informatique | 2020-02-12 00:10:22 +0100 |
commit | 19d40a5ee98fb1f244612155acc559ff2f21bf6b (patch) | |
tree | 836e46364b95197da1d643880e9ab259dce32076 /viewer/src/components/LdPicture.vue | |
parent | e61a7c84f1a1753186980ff1990ee146395ddfc1 (diff) | |
download | ldgallery-19d40a5ee98fb1f244612155acc559ff2f21bf6b.tar.gz |
viewer: implemented config.json
Note: The DevServer needs to know when the file is from the App, or from the FileSystem.
We use a tilde to make this separation. The tilde URL is declared in '.env.development'
GitHub: Resolves #32
Diffstat (limited to 'viewer/src/components/LdPicture.vue')
-rw-r--r-- | viewer/src/components/LdPicture.vue | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/viewer/src/components/LdPicture.vue b/viewer/src/components/LdPicture.vue index 8a9a08e..a5faeb3 100644 --- a/viewer/src/components/LdPicture.vue +++ b/viewer/src/components/LdPicture.vue | |||
@@ -28,7 +28,7 @@ | |||
28 | @dragscrollend="dragScrollClickFix.onDragScrollEnd()" | 28 | @dragscrollend="dragScrollClickFix.onDragScrollEnd()" |
29 | > | 29 | > |
30 | <v-lazy-image | 30 | <v-lazy-image |
31 | :src="pictureSrc()" | 31 | :src="pictureSrc(picture.properties.resource)" |
32 | :class="{'slow-loading': Boolean(slowLoadingStyle)}" | 32 | :class="{'slow-loading': Boolean(slowLoadingStyle)}" |
33 | :style="slowLoadingStyle" | 33 | :style="slowLoadingStyle" |
34 | @load="clearSlowLoading" | 34 | @load="clearSlowLoading" |
@@ -67,15 +67,17 @@ export default class LdPicture extends Vue { | |||
67 | this.loader = false; | 67 | this.loader = false; |
68 | } | 68 | } |
69 | 69 | ||
70 | pictureSrc() { | 70 | pictureSrc(resource: string) { |
71 | return `${process.env.VUE_APP_DATA_URL}${this.picture.properties.resource}`; | 71 | return `${process.env.VUE_APP_DATA_URL}${this.$galleryStore.config!.galleryRoot}${resource}`; |
72 | } | 72 | } |
73 | 73 | ||
74 | generateSlowLoadingStyle() { | 74 | generateSlowLoadingStyle() { |
75 | this.clearSlowLoading(); | 75 | this.clearSlowLoading(); |
76 | this.loader = true; | 76 | this.loader = true; |
77 | if (this.picture.thumbnail) | 77 | if (this.picture.thumbnail) { |
78 | this.slowLoadingStyle = `background-image: url('${process.env.VUE_APP_DATA_URL}${this.picture.thumbnail.resource}');`; | 78 | const url = this.pictureSrc(this.picture.thumbnail.resource); |
79 | this.slowLoadingStyle = `background-image: url('${url}');`; | ||
80 | } | ||
79 | } | 81 | } |
80 | } | 82 | } |
81 | </script> | 83 | </script> |