Twenty Seventeen: Resolves focused controls hidden by the top menu.

When a page is scrolled, the top nav menu become fixed. Depending on the page content this caused issue where focused links or buttons may be hidden behind the  nav menu.

Props afercia, davidakennedy, Fencer04
Fixes #38476


Built from https://develop.svn.wordpress.org/trunk@39225


git-svn-id: http://core.svn.wordpress.org/trunk@39165 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Tammie Lister 2016-11-14 17:01:30 +00:00
parent 1c2343e4ea
commit 9e110f8aed
2 changed files with 3 additions and 3 deletions

View File

@ -27,7 +27,7 @@
resizeTimer; resizeTimer;
// Ensure the sticky navigation doesn't cover current focused links. // Ensure the sticky navigation doesn't cover current focused links.
$( '#content a, #colophon a' ).focus( function() { $( 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [tabindex], [contenteditable]', '.site-content-contain' ).filter( ':visible' ).focus( function() {
if ( $navigation.hasClass( 'site-navigation-fixed' ) ) { if ( $navigation.hasClass( 'site-navigation-fixed' ) ) {
var windowScrollTop = $( window ).scrollTop(), var windowScrollTop = $( window ).scrollTop(),
fixedNavHeight = $navigation.height(), fixedNavHeight = $navigation.height(),
@ -40,7 +40,7 @@
} }
if ( offsetDiff < fixedNavHeight ) { if ( offsetDiff < fixedNavHeight ) {
$( window ).scrollTo( itemScrollTop - ( fixedNavHeight + 50 ), 600 ); $( window ).scrollTo( itemScrollTop - ( fixedNavHeight + 50 ), 0 );
} }
} }
}); });

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.7-beta3-39224'; $wp_version = '4.7-beta3-39225';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.