Make WordPress Core

Changeset 29897


Ignore:
Timestamp:
10/15/2014 05:48:05 AM (10 years ago)
Author:
azaozz
Message:

Twenty Fifteen: clean up skip-link-focus-fix.js, see #29799

File:
1 edited

Legend:

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

    r29892 r29897  
    77
    88( function() {
    9     var is_webkit = navigator.userAgent.toLowerCase().indexOf( 'webkit' ) > -1,
    10         is_opera  = navigator.userAgent.toLowerCase().indexOf( 'opera' )  > -1,
    11         is_ie     = navigator.userAgent.toLowerCase().indexOf( 'msie' )   > -1;
     9    var ua = navigator.userAgent.toLowerCase();
    1210
    13     if ( ( is_webkit || is_opera || is_ie ) && document.getElementById && window.addEventListener ) {
     11    if ( ( ua.indexOf( 'webkit' ) > -1 || ua.indexOf( 'opera' ) > -1 || ua.indexOf( 'msie' ) > -1 ) &&
     12        document.getElementById && window.addEventListener ) {
     13
    1414        window.addEventListener( 'hashchange', function() {
    1515            var element = document.getElementById( location.hash.substring( 1 ) );
    1616
    1717            if ( element ) {
    18                 if ( ! /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) {
     18                if ( ! /^(?:a|select|input|button|textarea)$/i.test( element.nodeName ) ) {
    1919                    element.tabIndex = -1;
    2020                }
Note: See TracChangeset for help on using the changeset viewer.