wp core update 6.6
This commit is contained in:
@@ -95,11 +95,6 @@
|
||||
} );
|
||||
}
|
||||
|
||||
if ( skipLink ) {
|
||||
// Focus the target of skip link after pressing Enter.
|
||||
skipLink.addEventListener( 'keydown', focusTargetAfterEnter );
|
||||
}
|
||||
|
||||
if ( shortlink ) {
|
||||
shortlink.addEventListener( 'click', clickShortlink );
|
||||
}
|
||||
@@ -174,36 +169,7 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Focus the target of skip link after pressing Enter.
|
||||
*
|
||||
* @since 5.3.1
|
||||
*
|
||||
* @param {Event} event The keydown event.
|
||||
*/
|
||||
function focusTargetAfterEnter( event ) {
|
||||
var id, userAgent;
|
||||
|
||||
if ( event.which !== 13 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
id = event.target.getAttribute( 'href' );
|
||||
userAgent = navigator.userAgent.toLowerCase();
|
||||
|
||||
if ( userAgent.indexOf( 'applewebkit' ) > -1 && id && id.charAt( 0 ) === '#' ) {
|
||||
setTimeout( function() {
|
||||
var target = document.getElementById( id.replace( '#', '' ) );
|
||||
|
||||
if ( target ) {
|
||||
target.setAttribute( 'tabIndex', '0' );
|
||||
target.focus();
|
||||
}
|
||||
}, 100 );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Toogle hover class for mobile devices.
|
||||
* Toggle hover class for mobile devices.
|
||||
*
|
||||
* @since 5.3.1
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user