(function ( $ ) {
'use strict';
$( document ).ready( function () {
$( 'body' ).on( 'adding_to_cart', function ( event, $button, data ) {
if ( $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' );
}
if ( $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();
}
} );
} );
})( window.jquery );