fix(extra-features): Fixed the sync product image/gallery
This commit is contained in:
@@ -13,6 +13,7 @@ import "@js/theme/components/quickview";
|
||||
import "@js/theme/components/product";
|
||||
import "@js/theme/components/cart/cart";
|
||||
import "@js/theme/components/cart/block-cart";
|
||||
import "@js/theme/components/product-miniature-form.js";
|
||||
|
||||
import usePasswordPolicy from "@js/theme/components/usePasswordPolicy";
|
||||
import prestashop from "prestashop";
|
||||
@@ -66,22 +67,6 @@ 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();
|
||||
|
||||
Reference in New Issue
Block a user