Making WordPress.org

Changeset 3415


Ignore:
Timestamp:
06/17/2016 01:19:19 PM (9 years ago)
Author:
obenland
Message:

Plugin Directory: Only track sections when expanding them.

See [3410].

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/js/section-accordion.js

    r3410 r3415  
    66
    77            $( '#' + sectionId ).toggleClass( 'toggled' ).attr( 'aria-expanded', function( index, attribute ) {
    8                 return 'false' === attribute;
     8                var notExpanded = 'false' === attribute;
     9
     10                if ( notExpanded ) {
     11                    _gaq.push(['_trackPageview', window.location.pathname + sectionId + '/' ]);
     12                }
     13
     14                return notExpanded;
    915            } );
    1016
    1117            $( '.read-more:not( #' + sectionId + ')' ).removeClass( 'toggled' ).attr( 'aria-expanded', false );
    12 
    13             _gaq.push(['_trackPageview', window.location.pathname + sectionId + '/' ]);
    1418        } );
    1519    } );
Note: See TracChangeset for help on using the changeset viewer.