Changeset 689
- Timestamp:
- 06/07/2014 06:07:05 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/function-reference.js
r687 r689 5 5 */ 6 6 ( function( $ ) { 7 var $sourceContent, $sourceCodeContainer, $sourceCodeTable, $showCompleteSource, $lessCompleteSource, $sourceCollapsedHeight;7 var $sourceContent, $sourceCodeContainer, $sourceCodeTable, $showCompleteSource, $lessCompleteSource, sourceCollapsedHeight; 8 8 9 9 function toggleCompleteSource( e ) { … … 11 11 12 12 if ( $showCompleteSource.is(':visible') ) { 13 var heightGoal = $sourceCodeTable.height() + 37; // takes into consideration potential x-scrollbar13 var heightGoal = $sourceCodeTable.height() + 45; // takes into consideration potential x-scrollbar 14 14 } else { 15 var heightGoal = $sourceCollapsedHeight;15 var heightGoal = sourceCollapsedHeight; 16 16 } 17 17 … … 33 33 $sourceCodeTable = $sourceContent.find( 'table' ); 34 34 35 // 1em (margin) + 20 * 17px. Lines are 1.1em which rounds to 17px: calc( 1em + 17px * 20 ).35 // 1em (margin) + 10 * 17px + 10. Lines are 1.1em which rounds to 17px: calc( 1em + 17px * 10 + 10 ). 36 36 // Extra 10px added to partially show next line so it's clear there is more. 37 $sourceCollapsedHeight = 196;37 sourceCollapsedHeight = 196; 38 38 39 if ( ( $sourceCollapsedHeight - 12 ) < $sourceCodeTable.height() ) {39 if ( ( sourceCollapsedHeight - 12 ) < $sourceCodeTable.height() ) { 40 40 41 41 // Do this with javascript so javascript-less can enjoy the total sourcecode 42 $( '.source-code-container' ).css( { height: $sourceCollapsedHeight + 'px' } );42 $( '.source-code-container' ).css( { height: sourceCollapsedHeight + 'px' } ); 43 43 44 44 $showCompleteSource = $( '.show-complete-source' );
Note: See TracChangeset
for help on using the changeset viewer.