From 581fc9ff692e5a84b272c5f944ada1d5d723b725 Mon Sep 17 00:00:00 2001 From: Lorenz Padberg Date: Fri, 3 May 2024 15:00:21 +0200 Subject: [PATCH] Remove console logs, fix up down scaling --- client/src/components/ui/WagtailImage.vue | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/client/src/components/ui/WagtailImage.vue b/client/src/components/ui/WagtailImage.vue index 507be47f..815a527d 100644 --- a/client/src/components/ui/WagtailImage.vue +++ b/client/src/components/ui/WagtailImage.vue @@ -48,32 +48,20 @@ const updateDimensions = () => { height.value = clientHeight; } calculateBackgroundHeight(); - console.log('sizes ', width.value, height.value); }; const calculateBackgroundHeight = () => { // calculate the hight of the background so, that you see a gray box of correct height before image is loaded - console.log('calculateBackgrondHeight'); if (width.value) { const scalingFactor = width.value / props.originalWidth; scaledHeight.value = Math.round(props.originalHeight * scalingFactor); - if (height.value > 3 && height.value < scaledHeight.value && imgElement.value) { - // if parents height is limited and smaller than the scaled height - const { clientHeight } = imgElement.value.parentElement; - backgroundHeight.value = `${clientHeight}px`; - console.log('calculateBackgrondHeight a', backgroundHeight.value); - return; - } - if (width.value) { backgroundHeight.value = `${scaledHeight.value}px`; - console.log('calculateBackgrondHeight b ', backgroundHeight.value); return; } } backgroundHeight.value = '100%'; - console.log('calculateBackgrondHeight c', backgroundHeight.value); }; const handleLoad = () => { @@ -111,8 +99,10 @@ onBeforeUnmount(() => { .wagtail-image { overflow: hidden; + height: 100%; &__background { + max-height: 100%; background-color: $color-silver-light; }