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

git-svn-id: https://develop.svn.wordpress.org/trunk@29897 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2014-10-15 05:48:05 +00:00
parent 2796b6969f
commit 2b93139fc9

View File

@@ -6,16 +6,16 @@
*/
( function() {
var is_webkit = navigator.userAgent.toLowerCase().indexOf( 'webkit' ) > -1,
is_opera = navigator.userAgent.toLowerCase().indexOf( 'opera' ) > -1,
is_ie = navigator.userAgent.toLowerCase().indexOf( 'msie' ) > -1;
var ua = navigator.userAgent.toLowerCase();
if ( ( ua.indexOf( 'webkit' ) > -1 || ua.indexOf( 'opera' ) > -1 || ua.indexOf( 'msie' ) > -1 ) &&
document.getElementById && window.addEventListener ) {
if ( ( is_webkit || is_opera || is_ie ) && document.getElementById && window.addEventListener ) {
window.addEventListener( 'hashchange', function() {
var element = document.getElementById( location.hash.substring( 1 ) );
if ( element ) {
if ( ! /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) {
if ( ! /^(?:a|select|input|button|textarea)$/i.test( element.nodeName ) ) {
element.tabIndex = -1;
}
@@ -23,4 +23,4 @@
}
}, false );
}
} )();
} )();