From 774db1873ae6f10e2a0b4b5779aeb9a17b90ad94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Gr=C3=B6ger?= Date: Sat, 20 Nov 2021 10:48:10 +0100 Subject: [PATCH] [chore] better filepicker for images --- src/components/CalculationTable.vue | 29 ++++++++++++++--------- src/components/DrinkModify.vue | 36 ++++++++++++++++++----------- src/utils/image.ts | 4 ++-- 3 files changed, 43 insertions(+), 26 deletions(-) diff --git a/src/components/CalculationTable.vue b/src/components/CalculationTable.vue index 8e6c0f8..3a388fa 100644 --- a/src/components/CalculationTable.vue +++ b/src/components/CalculationTable.vue @@ -37,9 +37,13 @@ - +
0) { - setNewImage(drink.id) + setNewImage(drink.id); } } editDrink.value = undefined; @@ -565,15 +574,13 @@ export default defineComponent({ function image(id: number | undefined) { if (id) { - const _newImage = getNewImage(id) + const _newImage = getNewImage(id); if (_newImage) { return `${ api.defaults.baseURL || '' - }/pricelist/drinks/${id}/picture?thumbnail?t=${_newImage.lastModified.toString()}` + }/pricelist/drinks/${id}/picture?thumbnail?t=${_newImage.lastModified.toString()}`; } - return `${ - api.defaults.baseURL || '' - }/pricelist/drinks/${id}/picture?thumbnail`; + return `${api.defaults.baseURL || ''}/pricelist/drinks/${id}/picture?thumbnail`; } return 'no-image.svg'; } diff --git a/src/components/DrinkModify.vue b/src/components/DrinkModify.vue index 568f132..37e20af 100644 --- a/src/components/DrinkModify.vue +++ b/src/components/DrinkModify.vue @@ -24,26 +24,28 @@
-
-