Making WordPress.org

Changeset 689


Ignore:
Timestamp:
06/07/2014 06:07:05 PM (12 years ago)
Author:
coffee2code
Message:

Code Reference: JS tweaks: proper variable naming, correct inline docs regarding height calculation; adjust expanded height. props atimmer

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  
    55 */
    66( function( $ ) {
    7         var $sourceContent, $sourceCodeContainer, $sourceCodeTable, $showCompleteSource, $lessCompleteSource, $sourceCollapsedHeight;
     7        var $sourceContent, $sourceCodeContainer, $sourceCodeTable, $showCompleteSource, $lessCompleteSource, sourceCollapsedHeight;
    88
    99        function toggleCompleteSource( e ) {
     
    1111
    1212                if ( $showCompleteSource.is(':visible') ) {
    13                         var heightGoal = $sourceCodeTable.height() + 37; // takes into consideration potential x-scrollbar
     13                        var heightGoal = $sourceCodeTable.height() + 45; // takes into consideration potential x-scrollbar
    1414                } else {
    15                         var heightGoal = $sourceCollapsedHeight;
     15                        var heightGoal = sourceCollapsedHeight;
    1616                }
    1717
     
    3333                $sourceCodeTable = $sourceContent.find( 'table' );
    3434
    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 ).
    3636                // Extra 10px added to partially show next line so it's clear there is more.
    37                 $sourceCollapsedHeight = 196;
     37                sourceCollapsedHeight = 196;
    3838
    39                 if ( ( $sourceCollapsedHeight - 12 ) < $sourceCodeTable.height() ) {
     39                if ( ( sourceCollapsedHeight - 12 ) < $sourceCodeTable.height() ) {
    4040
    4141                        // 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' } );
    4343
    4444                        $showCompleteSource = $( '.show-complete-source' );
Note: See TracChangeset for help on using the changeset viewer.