From f84883309160ebb7abd694ae1245d1964984e354 Mon Sep 17 00:00:00 2001 From: Isabelle Date: Tue, 10 Mar 2026 16:49:01 +0100 Subject: [PATCH] feat(extra-features): synchronize product thumbnail height --- falcon/_dev/js/theme/index.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/falcon/_dev/js/theme/index.js b/falcon/_dev/js/theme/index.js index 323fef8..0215387 100644 --- a/falcon/_dev/js/theme/index.js +++ b/falcon/_dev/js/theme/index.js @@ -66,6 +66,22 @@ function initStickyHeader() { } } +// Sync product thumbs height with main images height +function syncThumbsHeight() { + const mainImages = document.querySelector(".product-main-images"); + const thumbs = document.querySelector(".product-thumbs.swiper"); + // Only apply if Swiper is vertical + if (mainImages && thumbs && thumbs.classList.contains("swiper-vertical")) { + thumbs.style.maxHeight = mainImages.offsetHeight + "px"; + thumbs.style.height = mainImages.offsetHeight + "px"; + } else { + return; + } +} + +window.addEventListener("load", syncThumbsHeight); +window.addEventListener("resize", syncThumbsHeight); + $(() => { initStickyHeader(); accLinksTriggerActive();