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

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


git-svn-id: http://core.svn.wordpress.org/trunk@29652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2014-10-15 05:49:19 +00:00
parent 09fbcfc1ad
commit ca92ca385e
1 changed files with 6 additions and 6 deletions

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;
}