From 5d291495a74ae0b301b54fef0c0c41e785393a5b Mon Sep 17 00:00:00 2001 From: Shiva Poudel Date: Fri, 21 Aug 2015 21:27:34 +0545 Subject: [PATCH] Tweak - GTM listener for wc-tabs using preventDefault() --- assets/js/admin/meta-boxes.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/js/admin/meta-boxes.js b/assets/js/admin/meta-boxes.js index acac48ab81f..267d4c27fbe 100644 --- a/assets/js/admin/meta-boxes.js +++ b/assets/js/admin/meta-boxes.js @@ -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();