window.jQuery( document ).ready( function ( $ ) {
$( 'body' ).on( 'adding_to_cart', function ( event, $button, data ) {
$button && $button.hasClass( 'vc_gitem-link' ) && $button
.addClass( 'vc-gitem-add-to-cart-loading-btn' )
.parents( '.vc_grid-item-mini' )
.addClass( 'vc-woocommerce-add-to-cart-loading' )
.append( $( '
' ) );
} ).on( 'added_to_cart', function ( event, fragments, cart_hash, $button ) {
if ( 'undefined' === typeof($button) ) {
$button = $( '.vc-gitem-add-to-cart-loading-btn' );
}
$button && $button.hasClass( 'vc_gitem-link' ) && $button
.removeClass( 'vc-gitem-add-to-cart-loading-btn' )
.parents( '.vc_grid-item-mini' )
.removeClass( 'vc-woocommerce-add-to-cart-loading' )
.find( '.vc_wc-load-add-to-loader-wrapper' ).remove();
} );
} );