From 053567d2ad81fefbd5e52e3ba15cf7511205a963 Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Tue, 28 Jun 2022 11:05:39 +1000
Subject: Add getImagePath() to lib.ts

---
 src/components/Tile.vue | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'src/components/Tile.vue')

diff --git a/src/components/Tile.vue b/src/components/Tile.vue
index 15b8a0b..2a59d94 100644
--- a/src/components/Tile.vue
+++ b/src/components/Tile.vue
@@ -51,7 +51,7 @@
 <script lang="ts">
 import {defineComponent, PropType} from 'vue';
 import InfoIcon from './icon/InfoIcon.vue';
-import {TolNode, TolMap, UiOptions} from '../lib';
+import {TolNode, TolMap, getImagePath, UiOptions} from '../lib';
 import {LayoutNode, LayoutOptions} from '../layout';
 import {capitalizeWords} from '../util';
 
@@ -215,7 +215,7 @@ export default defineComponent({
 				styles = {
 					...styles,
 					backgroundImage: this.tolNode.imgName != null ?
-						`${scrimGradient},url('/img/${(this.tolNode.imgName as string).replaceAll('\'', '\\\'')}')` :
+						`${scrimGradient},url('${getImagePath(this.tolNode.imgName as string)}')` :
 						'none',
 					backgroundColor: this.uiOpts.bgColorDark,
 					backgroundSize: 'cover',
@@ -499,7 +499,7 @@ export default defineComponent({
 				height: '100%',
 				// Image (and scrims)
 				backgroundImage: (this.tolNode.imgName![idx]! != null) ?
-					`${scrimGradient},url('/img/${(this.tolNode.imgName![idx] as string).replaceAll('\'', '\\\'')}')` :
+					`${scrimGradient},url('${getImagePath(this.tolNode.imgName![idx]! as string)}')` :
 					'none',
 				backgroundColor: this.uiOpts.bgColorDark,
 				backgroundSize: '125%',
-- 
cgit v1.2.3

