fix product gallery lightbox trigger

This commit is contained in:
Maximus80 2017-02-21 09:11:39 +01:00
parent b3917c0ab7
commit ea97b60d49
1 changed files with 6 additions and 2 deletions

View File

@ -198,10 +198,14 @@ jQuery( function( $ ) {
var pswpElement = $( '.pswp' )[0],
items = wc_product_gallery.get_gallery_items(),
target = $( e.target ),
index = -1;
index = -1,
clicked;
if ( ! target.is( '.woocommerce-product-gallery__trigger' ) ) {
var clicked = e.target.closest( 'figure' );
clicked = e.target.closest( 'figure' );
index = $( clicked ).index();
} else {
clicked = target.parents( '.woocommerce-product-gallery' ).find( '.flex-active-slide' );
index = $( clicked ).index();
}