diff --git a/wp-content/themes/twentythirteen/functions.php b/wp-content/themes/twentythirteen/functions.php index 021cd747b9..154becbe3e 100644 --- a/wp-content/themes/twentythirteen/functions.php +++ b/wp-content/themes/twentythirteen/functions.php @@ -218,7 +218,7 @@ function twentythirteen_scripts_styles() { wp_enqueue_script( 'jquery-masonry' ); // Loads JavaScript file with functionality specific to Twenty Thirteen. - wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20130423', true ); + wp_enqueue_script( 'twentythirteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20130625', true ); // Loads our main stylesheet. wp_enqueue_style( 'twentythirteen-style', get_stylesheet_uri() ); diff --git a/wp-content/themes/twentythirteen/js/functions.js b/wp-content/themes/twentythirteen/js/functions.js index 87b42b2bd5..7248fac047 100644 --- a/wp-content/themes/twentythirteen/js/functions.js +++ b/wp-content/themes/twentythirteen/js/functions.js @@ -5,28 +5,23 @@ */ ( function( $ ) { - var html = $( 'html' ), - body = $( 'body' ), - _window = $( window ), - adjustFooter, + var body = $( 'body' ), + _window = $( window ), /** - * Adds a top margin to the footer if the sidebar widget area is - * higher than the rest of the page, to help the footer always - * visually clear the sidebar. + * Adds a top margin to the footer if the sidebar widget area is higher + * than the rest of the page, to help the footer always visually clear + * the sidebar. */ - adjustFooter = function() { - var sidebar = $( '#secondary .widget-area' ), - secondary = ( 0 == sidebar.length ) ? -40 : sidebar.height(), - margin = $( '#tertiary .widget-area' ).height() - $( '#content' ).height() - secondary; - - if ( margin > 0 && _window.innerWidth() > 999 ) - $( '#colophon' ).css( 'margin-top', margin + 'px' ); - }; - $( function() { - if ( body.is( '.sidebar' ) ) - adjustFooter(); + if ( body.is( '.sidebar' ) ) { + var sidebar = $( '#secondary .widget-area' ), + secondary = ( 0 == sidebar.length ) ? -40 : sidebar.height(), + margin = $( '#tertiary .widget-area' ).height() - $( '#content' ).height() - secondary; + + if ( margin > 0 && _window.innerWidth() > 999 ) + $( '#colophon' ).css( 'margin-top', margin + 'px' ); + } } ); /** @@ -38,11 +33,11 @@ return; button = nav.find( '.menu-toggle' ); - menu = nav.find( '.nav-menu' ); if ( ! button ) return; // Hide button if menu is missing or empty. + menu = nav.find( '.nav-menu' ); if ( ! menu || ! menu.children().length ) { button.hide(); return;