Changeset 3416
- Timestamp:
- 06/17/2016 01:34:40 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/js/section-accordion.js
r3415 r3416 1 1 /* global _gaq */ 2 ( function( $ ) { 3 $( function() { 4 $( '#main' ).on( 'click', '.section-toggle', function( event ) { 5 var sectionId = $( event.target ).attr( 'aria-controls' ); 6 7 $( '#' + sectionId ).toggleClass( 'toggled' ).attr( 'aria-expanded', function( index, attribute ) { 2 ( function( $, wporg ) { 3 wporg.plugins = { 4 toggle: function( sectionId ) { 5 $( sectionId ).toggleClass( 'toggled' ).attr( 'aria-expanded', function( index, attribute ) { 8 6 var notExpanded = 'false' === attribute; 9 7 … … 15 13 } ); 16 14 17 $( '.read-more:not( #' + sectionId + ')' ).removeClass( 'toggled' ).attr( 'aria-expanded', false ); 15 $( '.read-more:not(' + sectionId + ')' ).removeClass( 'toggled' ).attr( 'aria-expanded', false ); 16 } 17 }; 18 19 $( function() { 20 if ( document.location.hash ) { 21 wporg.plugins.toggle( document.location.hash ); 22 } 23 24 $( window ).on( 'hashchange', function() { 25 wporg.plugins.toggle( document.location.hash ); 26 } ); 27 28 $( '#main' ).on( 'click', '.section-toggle', function( event ) { 29 wporg.plugins.toggle( '#' + $( event.target ).attr( 'aria-controls' ) ); 18 30 } ); 19 31 } ); 20 } )( window.jQuery );32 } )( window.jQuery, window.wporg || {} );
Note: See TracChangeset
for help on using the changeset viewer.