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 | |
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')
-rw-r--r-- | viewer/src/components/LdPicture.vue | 12 | ||||
-rw-r--r-- | viewer/src/components/LdThumbnail.vue | 7 |
2 files changed, 10 insertions, 9 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> |
diff --git a/viewer/src/components/LdThumbnail.vue b/viewer/src/components/LdThumbnail.vue index 17c7659..13468e1 100644 --- a/viewer/src/components/LdThumbnail.vue +++ b/viewer/src/components/LdThumbnail.vue | |||
@@ -21,7 +21,7 @@ | |||
21 | <div :class="{'preload': loading}"> | 21 | <div :class="{'preload': loading}"> |
22 | <v-lazy-image | 22 | <v-lazy-image |
23 | v-if="item.thumbnail" | 23 | v-if="item.thumbnail" |
24 | :src="pictureSrc()" | 24 | :src="pictureSrc(item.thumbnail.resource)" |
25 | :style="pictureStyle()" | 25 | :style="pictureStyle()" |
26 | :title="item.title" | 26 | :title="item.title" |
27 | @intersect="loading=true" | 27 | @intersect="loading=true" |
@@ -44,9 +44,8 @@ export default class LdThumbnail extends Vue { | |||
44 | 44 | ||
45 | loading: boolean = false; | 45 | loading: boolean = false; |
46 | 46 | ||
47 | pictureSrc() { | 47 | pictureSrc(resource: string) { |
48 | const resource = this.item.thumbnail!.resource; | 48 | return `${process.env.VUE_APP_DATA_URL}${this.$galleryStore.config!.galleryRoot}${resource}`; |
49 | return `${process.env.VUE_APP_DATA_URL}${resource}`; | ||
50 | } | 49 | } |
51 | 50 | ||
52 | pictureStyle() { | 51 | pictureStyle() { |