WordPress.org

Make WordPress Core

Changeset 31934


Ignore:
Timestamp:
03/30/2015 10:48:11 PM (6 years ago)
Author:
lancewillett
Message:

Twenty Fifteen: adjust scroll behavior to make sure sidebar height is calculated during scroll events, not just resize events.

Fixes #31734. Props jartes, lancewillett.

Location:
trunk/src/wp-content/themes/twentyfifteen
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfifteen/functions.php

    r31500 r31934  
    251251    }
    252252
    253     wp_enqueue_script( 'twentyfifteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20141212', true );
     253    wp_enqueue_script( 'twentyfifteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20150330', true );
    254254    wp_localize_script( 'twentyfifteen-script', 'screenReaderText', array(
    255255        'expand'   => '<span class="screen-reader-text">' . __( 'expand child menu', 'twentyfifteen' ) . '</span>',
  • trunk/src/wp-content/themes/twentyfifteen/js/functions.js

    r31814 r31934  
    8181    // Sidebar scrolling.
    8282    function resize() {
    83         windowWidth   = $window.width();
    84         windowHeight  = $window.height();
    85         bodyHeight    = $body.height();
    86         sidebarHeight = $sidebar.height();
     83        windowWidth = $window.width();
    8784
    8885        if ( 955 > windowWidth ) {
     
    9895            return;
    9996        }
     97
     98        sidebarHeight = $sidebar.height();
     99        windowHeight  = $window.height();
     100        bodyHeight    = $body.height();
    100101
    101102        if ( sidebarHeight + adminbarOffset > windowHeight ) {
Note: See TracChangeset for help on using the changeset viewer.