From 00db1e4b554c6c761274aba316b71fa828c4a561 Mon Sep 17 00:00:00 2001 From: alexanderroese Date: Wed, 17 Jul 2024 19:39:57 +0200 Subject: [PATCH] select with images --- snippets/product-variant-picker.liquid | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/snippets/product-variant-picker.liquid b/snippets/product-variant-picker.liquid index 31ca847..550287a 100644 --- a/snippets/product-variant-picker.liquid +++ b/snippets/product-variant-picker.liquid @@ -107,10 +107,10 @@ {{ option.name }} -
+
-
-
+
{% for product_variant in product.variants %}
@@ -172,11 +172,11 @@ // Remove the selected style from all items document.querySelectorAll('.shx-custom-variant-picker-dropdown-content div').forEach(div => { - div.classList.remove('shx-custom-variant-picker-selected-variant'); + div.classList.remove('shx-custom-enhanced-dropdown-variant-selected'); }); // Add the selected style to the clicked item - event.currentTarget.classList.add('shx-custom-variant-picker-selected-variant'); + event.currentTarget.classList.add('shx-custom-enhanced-dropdown-variant-selected'); dropdownContent.style.display = 'none'; @@ -190,7 +190,7 @@ // Close the dropdown if the user clicks outside of it window.addEventListener('click', function(event) { - if (!event.target.matches('.shx-custom-variant-picker-dropbtn')) { + if (!event.target.matches('.shx-custom-enhanced-dropdown-dropbtn')) { if (dropdownContent.style.display === 'block') { dropdownContent.style.display = 'none'; }