From f328a730b516f5e9104f85e553c083c2865660a8 Mon Sep 17 00:00:00 2001 From: pacien Date: Mon, 4 May 2020 00:10:39 +0200 Subject: viewer/galleryStore: unify resource root parametrisation --- viewer/src/components/LdPicture.vue | 2 +- viewer/src/components/LdThumbnail.vue | 2 +- viewer/src/store/galleryStore.ts | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'viewer/src') diff --git a/viewer/src/components/LdPicture.vue b/viewer/src/components/LdPicture.vue index de46bcb..78829ec 100644 --- a/viewer/src/components/LdPicture.vue +++ b/viewer/src/components/LdPicture.vue @@ -76,7 +76,7 @@ export default class LdPicture extends Vue { } pictureSrc(resource: string) { - return `${process.env.VUE_APP_DATA_URL}${this.$galleryStore.config!.galleryRoot}${resource}`; + return this.$galleryStore.resourceRoot + resource; } generateSlowLoadingStyle() { diff --git a/viewer/src/components/LdThumbnail.vue b/viewer/src/components/LdThumbnail.vue index e774f00..bfcc595 100644 --- a/viewer/src/components/LdThumbnail.vue +++ b/viewer/src/components/LdThumbnail.vue @@ -47,7 +47,7 @@ export default class LdThumbnail extends Vue { loading: boolean = false; pictureSrc(resource: string) { - return `${process.env.VUE_APP_DATA_URL}${this.$galleryStore.config!.galleryRoot}${resource}`; + return this.$galleryStore.resourceRoot + resource; } pictureStyle() { diff --git a/viewer/src/store/galleryStore.ts b/viewer/src/store/galleryStore.ts index 0cffdd9..a57122c 100644 --- a/viewer/src/store/galleryStore.ts +++ b/viewer/src/store/galleryStore.ts @@ -79,6 +79,10 @@ export default class GalleryStore extends VuexModule { return this.galleryIndex?.properties.galleryTitle ?? "ldgallery"; } + get resourceRoot(): string { + return process.env.VUE_APP_DATA_URL + this.config!.galleryRoot; + } + // --- // Fetches the gallery's JSON config -- cgit v1.2.3