mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
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.
git-svn-id: https://develop.svn.wordpress.org/trunk@53247 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
b1a1bdd88c
commit
f1235f2cba
@ -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'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user