Merge pull request #13707 from woocommerce/fix-13699

Abort gallery script when there are no images
This commit is contained in:
Claudio Sanches 2017-03-22 10:56:49 -03:00 committed by GitHub
commit 40a86c28eb
2 changed files with 6 additions and 1 deletions

View File

@ -77,6 +77,11 @@ jQuery( function( $ ) {
this.$target = $target;
this.$images = $( '.woocommerce-product-gallery__image', $target );
// No images? Abort.
if ( 0 === this.$images.length ) {
return;
}
// Make this object available.
$target.data( 'product_gallery', this );

File diff suppressed because one or more lines are too long