fix product gallery lightbox trigger
This commit is contained in:
parent
b3917c0ab7
commit
ea97b60d49
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue