Make WordPress Core

Changeset 39135


Ignore:
Timestamp:
11/03/2016 11:07:20 PM (8 years ago)
Author:
davidakennedy
Message:

Twenty Seventeen: Make sure skip link works in all versions of Internet Explorer

This also reduces the number of browsers detected and patched with this fix. Most modern browsers have patched this common bug, where an anchor link does not move focus when clicked. Twenty Seventeen will only worry about older versions of Internet Explorer in this regard.

Props afercia, sami.keijonen.

See #38604.

Location:
trunk/src/wp-content/themes/twentyseventeen
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyseventeen/assets/js/skip-link-focus-fix.js

    r38833 r39135  
    77 */
    88( function() {
    9     var isWebkit = navigator.userAgent.toLowerCase().indexOf( 'webkit' ) > -1,
    10         isOpera  = navigator.userAgent.toLowerCase().indexOf( 'opera' )  > -1,
    11         isIe     = navigator.userAgent.toLowerCase().indexOf( 'msie' )   > -1;
     9    var isIe = /(trident|msie)/i.test( navigator.userAgent );
    1210
    13     if ( ( isWebkit || isOpera || isIe ) && document.getElementById && window.addEventListener ) {
     11    if ( isIe && document.getElementById && window.addEventListener ) {
    1412        window.addEventListener( 'hashchange', function() {
    1513            var id = location.hash.substring( 1 ),
  • trunk/src/wp-content/themes/twentyseventeen/style.css

    r39129 r39135  
    329329    width: auto;
    330330    z-index: 100000; /* Above WP toolbar. */
    331 }
    332 
    333 /* Do not show the outline on the skip link target. */
    334 
    335 #content[tabindex="-1"]:focus {
    336     outline: 0;
    337331}
    338332
Note: See TracChangeset for help on using the changeset viewer.