Make WordPress Core

Changeset 30808


Ignore:
Timestamp:
12/10/2014 11:01:03 PM (10 years ago)
Author:
iandstewart
Message:

Twenty Fifteen: correcting odd scrolling and jumping in IE and no-scroll with window resize.

Props iamtakashi, ocean90, fixes #30632, #30645.

File:
1 edited

Legend:

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

    r30804 r30808  
    77
    88( function( $ ) {
    9     var $body, $window, $document, $sidebar, adminbarOffset, top = false,
    10         bottom = false, windowWidth, windowHeight, lastWindowPos = 0,
    11         topOffset = 0, documentHeight, sidebarHeight, resizeTimer;
     9    var $body, $window, $sidebar, adminbarOffset, top = false,
     10        bottom = false, windowWidth, windowHeight, lastWindowPos = 0,
     11        topOffset = 0, bodyHeight, sidebarHeight, resizeTimer;
    1212
    1313    // Add dropdown toggle that display child menu items.
     
    5353    // Sidebar scrolling.
    5454    function resize() {
    55         windowWidth = $window.width();
    56         windowHeight = $window.height();
    57         documentHeight = $document.height();
     55        windowWidth   = $window.width();
     56        windowHeight  = $window.height();
     57        bodyHeight    = $body.height();
    5858        sidebarHeight = $sidebar.height();
    5959
     
    6767        var windowPos = $window.scrollTop();
    6868
    69         if ( 955 <= windowWidth && sidebarHeight + adminbarOffset < documentHeight ) {
     69        if ( 955 <= windowWidth && sidebarHeight + adminbarOffset < bodyHeight ) {
    7070            if ( sidebarHeight + adminbarOffset > windowHeight ) {
    7171                if ( windowPos > lastWindowPos ) {
     
    107107
    108108    $( document ).ready( function() {
    109         $body          = $( 'body' );
     109        $body          = $( document.body );
    110110        $window        = $( window );
    111         $document      = $( document );
    112         $sidebar        = $( '#sidebar' ).first();
     111        $sidebar       = $( '#sidebar' ).first();
    113112        adminbarOffset = $body.is( '.admin-bar' ) ? $( '#wpadminbar' ).height() : 0;
    114113
Note: See TracChangeset for help on using the changeset viewer.