Merge pull request #8921 from shivapoudel/wc-tabs-gtm

GTM listener for wc-tabs
This commit is contained in:
Claudio Sanches 2015-09-15 19:49:48 -03:00
commit 9865e04c8a
1 changed files with 2 additions and 2 deletions

View File

@ -34,13 +34,13 @@ jQuery( function ( $ ) {
// Tabbed Panels
$( document.body ).on( 'wc-init-tabbed-panels', function() {
$( 'ul.wc-tabs' ).show();
$( 'ul.wc-tabs a' ).click( function() {
$( 'ul.wc-tabs a' ).click( function( e ) {
e.preventDefault();
var panel_wrap = $( this ).closest( 'div.panel-wrap' );
$( 'ul.wc-tabs li', panel_wrap ).removeClass( 'active' );
$( this ).parent().addClass( 'active' );
$( 'div.panel', panel_wrap ).hide();
$( $( this ).attr( 'href' ) ).show();
return false;
});
$( 'div.panel-wrap' ).each( function() {
$( this ).find( 'ul.wc-tabs li' ).eq( 0 ).find( 'a' ).click();