Skip to content

Commit

Permalink
[Product] Zoom on hover fix on variant change (#3511)
Browse files Browse the repository at this point in the history
* Zoom on hover fix on variant change

* add conditional
  • Loading branch information
ludoboludo authored Jun 10, 2024
1 parent 6495238 commit b3b26e1
Show file tree
Hide file tree
Showing 3 changed files with 450 additions and 443 deletions.
7 changes: 2 additions & 5 deletions assets/product-info.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,7 @@ if (!customElements.get('product-info')) {
updateOptionValues(html) {
const variantSelects = html.querySelector('variant-selects');
if (variantSelects) {
HTMLUpdateUtility.viewTransition(
this.variantSelectors,
variantSelects,
this.preProcessHtmlCallbacks,
);
HTMLUpdateUtility.viewTransition(this.variantSelectors, variantSelects, this.preProcessHtmlCallbacks);
}
}

Expand Down Expand Up @@ -261,6 +257,7 @@ if (!customElements.get('product-info')) {
const mediaGalleryDestination = html.querySelector(`media-gallery ul`);

const refreshSourceData = () => {
if (this.hasAttribute('data-zoom-on-hover')) enableZoomOnHover(2);
const mediaGallerySourceItems = Array.from(mediaGallerySource.querySelectorAll('li[data-media-id]'));
const sourceSet = new Set(mediaGallerySourceItems.map((item) => item.dataset.mediaId));
const sourceMap = new Map(
Expand Down
Loading

0 comments on commit b3b26e1

Please sign in to comment.