From 57918dfc8fa7c1d5ab05243ca949bfc250f34e0d Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Mon, 30 Mar 2015 22:49:27 +0000 Subject: [PATCH] Twenty Fifteen: adjust scroll behavior to make sure sidebar height is calculated during scroll events, not just resize events. Fixes #31734. Props jartes, lancewillett. Built from https://develop.svn.wordpress.org/trunk@31934 git-svn-id: http://core.svn.wordpress.org/trunk@31913 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentyfifteen/functions.php | 2 +- wp-content/themes/twentyfifteen/js/functions.js | 9 +++++---- wp-includes/version.php | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/wp-content/themes/twentyfifteen/functions.php b/wp-content/themes/twentyfifteen/functions.php index d96c0270b3..1a8e8a3a38 100644 --- a/wp-content/themes/twentyfifteen/functions.php +++ b/wp-content/themes/twentyfifteen/functions.php @@ -250,7 +250,7 @@ function twentyfifteen_scripts() { wp_enqueue_script( 'twentyfifteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20141010' ); } - wp_enqueue_script( 'twentyfifteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20141212', true ); + wp_enqueue_script( 'twentyfifteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20150330', true ); wp_localize_script( 'twentyfifteen-script', 'screenReaderText', array( 'expand' => '' . __( 'expand child menu', 'twentyfifteen' ) . '', 'collapse' => '' . __( 'collapse child menu', 'twentyfifteen' ) . '', diff --git a/wp-content/themes/twentyfifteen/js/functions.js b/wp-content/themes/twentyfifteen/js/functions.js index 558869ac61..eeeecd2246 100644 --- a/wp-content/themes/twentyfifteen/js/functions.js +++ b/wp-content/themes/twentyfifteen/js/functions.js @@ -80,10 +80,7 @@ // Sidebar scrolling. function resize() { - windowWidth = $window.width(); - windowHeight = $window.height(); - bodyHeight = $body.height(); - sidebarHeight = $sidebar.height(); + windowWidth = $window.width(); if ( 955 > windowWidth ) { top = bottom = false; @@ -98,6 +95,10 @@ return; } + sidebarHeight = $sidebar.height(); + windowHeight = $window.height(); + bodyHeight = $body.height(); + if ( sidebarHeight + adminbarOffset > windowHeight ) { if ( windowPos > lastWindowPos ) { if ( top ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 3ddcf70855..5536581dfb 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-beta3-31933'; +$wp_version = '4.2-beta3-31934'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.