re-init zoom to fix case #20367
This commit is contained in:
parent
001a2e3b98
commit
ab6d5a8f75
|
@ -579,8 +579,13 @@
|
|||
if ( slideToImage.length > 0 ) {
|
||||
slideToImage.trigger( 'click' );
|
||||
$form.attr( 'current-image', variation.image_id );
|
||||
window.setTimeout( function() {
|
||||
$( window ).trigger( 'resize' );
|
||||
$product_gallery.trigger( 'woocommerce_gallery_init_zoom' );
|
||||
}, 20 );
|
||||
return;
|
||||
} else {
|
||||
}
|
||||
|
||||
$product_img.wc_set_variation_attr( 'src', variation.image.src );
|
||||
$product_img.wc_set_variation_attr( 'height', variation.image.src_h );
|
||||
$product_img.wc_set_variation_attr( 'width', variation.image.src_w );
|
||||
|
@ -595,7 +600,6 @@
|
|||
$product_img_wrap.wc_set_variation_attr( 'data-thumb', variation.image.src );
|
||||
$gallery_img.wc_set_variation_attr( 'src', variation.image.gallery_thumbnail_src );
|
||||
$product_link.wc_set_variation_attr( 'href', variation.image.full_src );
|
||||
}
|
||||
} else {
|
||||
$form.wc_variations_image_reset();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue