From d85bfc9f742a209662703d15419cc9153da87f9a Mon Sep 17 00:00:00 2001 From: Ivan Ramljak Date: Tue, 3 Dec 2024 15:51:29 +0100 Subject: [PATCH 1/2] Fix Image component responsive output Co-authored-by: goran.alkovic@infinum.com --- blocks/init/src/Blocks/components/image/image.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/blocks/init/src/Blocks/components/image/image.php b/blocks/init/src/Blocks/components/image/image.php index db136f9..28f444a 100644 --- a/blocks/init/src/Blocks/components/image/image.php +++ b/blocks/init/src/Blocks/components/image/image.php @@ -25,7 +25,7 @@ $isDesktopFirst = $imageData['_desktopFirst'] ?? false; $breakpointData = Helpers::getSettingsGlobalVariablesBreakpoints(); -$breakpoints = Helpers::getTwBreakpoints(); +$breakpoints = Helpers::getTwBreakpoints($isDesktopFirst); ?> > - + " continue; } - $breakpointWidth = $breakpointData[$breakpoint]; + $breakpointWidth = $breakpointData[str_replace('max-', '', $breakpoint)]; $widthMode = $isDesktopFirst ? 'max-width' : 'min-width'; From b1d702f41cb4f5d0fe8b70cddfbd0283744aa27a Mon Sep 17 00:00:00 2001 From: Ivan Ramljak Date: Wed, 4 Dec 2024 08:59:51 +0100 Subject: [PATCH 2/2] Move $isDesktopFirst conditional of Image component few lines up --- blocks/init/src/Blocks/components/image/image.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/blocks/init/src/Blocks/components/image/image.php b/blocks/init/src/Blocks/components/image/image.php index 28f444a..f0aaf9c 100644 --- a/blocks/init/src/Blocks/components/image/image.php +++ b/blocks/init/src/Blocks/components/image/image.php @@ -26,6 +26,10 @@ $breakpointData = Helpers::getSettingsGlobalVariablesBreakpoints(); $breakpoints = Helpers::getTwBreakpoints($isDesktopFirst); + +if (!$isDesktopFirst) { + $breakpoints = array_reverse($breakpoints); +} ?> >