Changeset 4385
- Timestamp:
- 11/21/2016 02:27:26 AM (7 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
r4376 r4385 17 17 initial_size: function( selector ) { 18 18 $( selector ).each( function( i, el) { 19 if ( $(el).height() / el.scrollHeight > 0.8 || el.id == 'screenshots' ) { 19 var $el = $(el); 20 if ( $el.height() / el.scrollHeight > 0.8 || el.id == 'screenshots' ) { 20 21 // Force the section to expand, and hide its button 21 $ (el).toggleClass( 'toggled' ).addClass('short-content').attr( 'aria-expanded', true );22 $el.toggleClass( 'toggled' ).addClass('short-content').attr( 'aria-expanded', true ); 22 23 $( '.section-toggle[aria-controls="' + el.id + '"]' ).hide(); 23 24 } else { 25 // If the description starts with an embed/video, set the min-height to include it. 26 if ( 'description' == el.id && $el.children().next('p,div').first().find('video,iframe') ) { 27 var height = $el.children().next('p,div').first().outerHeight(true) /* embed */ + $el.children().first().outerHeight(true) /* h2 */; 28 29 if ( height > parseInt($el.css( 'max-height' )) ) { 30 $el.css( 'min-height', height + "px" ); 31 } 32 } 33 24 34 // Contract the section and make sure its button is visible 25 $ (el).removeClass( 'short-content' ).attr( 'aria-expanded', false );35 $el.removeClass( 'short-content' ).attr( 'aria-expanded', false ); 26 36 $( '.section-toggle[aria-controls="' + el.id + '"]' ).show(); 27 37 }
Note: See TracChangeset
for help on using the changeset viewer.