From 76b7a4facf3e2b7190222feb8fcdf665a926fcee Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Wed, 20 Feb 2019 16:37:40 +0000 Subject: [PATCH 1/2] cs --- assets/js/frontend/single-product.js | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/assets/js/frontend/single-product.js b/assets/js/frontend/single-product.js index e80b46711f8..e4ba732e3f7 100644 --- a/assets/js/frontend/single-product.js +++ b/assets/js/frontend/single-product.js @@ -44,7 +44,19 @@ jQuery( function( $ ) { } ) // Star ratings for comments .on( 'init', '#rating', function() { - $( '#rating' ).hide().before( '

12345

' ); + $( '#rating' ) + .hide() + .before( + '

\ + \ + 1\ + 2\ + 3\ + 4\ + 5\ + \ +

' + ); } ) .on( 'click', '#respond p.stars a', function() { var $star = $( this ), @@ -307,12 +319,12 @@ jQuery( function( $ ) { * Initialize all galleries on page. */ $( '.woocommerce-product-gallery' ).each( function() { - + $( this ).trigger( 'wc-product-gallery-before-init', [ this, wc_single_product_params ] ); - + $( this ).wc_product_gallery( wc_single_product_params ); - + $( this ).trigger( 'wc-product-gallery-after-init', [ this, wc_single_product_params ] ); - + } ); } ); From fc1a274fcbaf9e463f5181dc999570602bc810f5 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Wed, 20 Feb 2019 17:22:43 +0000 Subject: [PATCH 2/2] Check for hover after timeout --- assets/js/frontend/single-product.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/assets/js/frontend/single-product.js b/assets/js/frontend/single-product.js index e4ba732e3f7..c31fa2dc60b 100644 --- a/assets/js/frontend/single-product.js +++ b/assets/js/frontend/single-product.js @@ -222,6 +222,12 @@ jQuery( function( $ ) { zoomTarget.trigger( 'zoom.destroy' ); zoomTarget.zoom( zoom_options ); + + setTimeout( function() { + if ( zoomTarget.find(':hover').length ) { + zoomTarget.trigger( 'mouseover' ); + } + }, 100 ); } };