From 9564a686977df59cd06ef907ee2eac1601071278 Mon Sep 17 00:00:00 2001 From: audrasjb Date: Sun, 24 Apr 2022 21:03:10 +0000 Subject: [PATCH] Twenty Fifteen: Use `#page` height instead of `body` height in sidebar scroll calculation. This changeset replaces `bodyHeight = $body.height();` with `bodyHeight = $('#page).height();`. It fixes a JS issue in some specific context, when there is content generated right before the closing `body` tag. For example, this happens when the HTML content is added using the `wp_footer` filter. Props stephenharris, sabernhardt, audrasjb. Fixes #40492. Built from https://develop.svn.wordpress.org/trunk@53247 git-svn-id: http://core.svn.wordpress.org/trunk@52836 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentyfifteen/js/functions.js | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-content/themes/twentyfifteen/js/functions.js b/wp-content/themes/twentyfifteen/js/functions.js index 1124de0d4d..ba102a0cb4 100644 --- a/wp-content/themes/twentyfifteen/js/functions.js +++ b/wp-content/themes/twentyfifteen/js/functions.js @@ -99,9 +99,9 @@ var windowPos = $window.scrollTop(), windowHeight = $window.height(), sidebarHeight = $sidebar.height(), - bodyHeight = $body.height(); + pageHeight = $( '#page' ).height(); - if( 955 < $window.width() && bodyHeight > sidebarHeight && ( windowPos + windowHeight ) >= sidebarHeight ) { + if ( 955 < $window.width() && pageHeight > sidebarHeight && ( windowPos + windowHeight ) >= sidebarHeight ) { $sidebar.css({ position: 'fixed', bottom: sidebarHeight > windowHeight ? 0 : 'auto' diff --git a/wp-includes/version.php b/wp-includes/version.php index 57573b0e25..2337ba9831 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-beta2-53246'; +$wp_version = '6.0-beta2-53247'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.