updated plugin GP Premium
version 2.2.2
This commit is contained in:
@ -572,25 +572,6 @@ var generateOffside = offside( '.slideout-navigation', {
|
||||
document.querySelector( '.slideout-navigation:not(.is-open)' ).style.visibility = '';
|
||||
document.querySelector( '.slideout-navigation:not(.is-open)' ).setAttribute( 'aria-hidden', 'true' );
|
||||
}, 500 );
|
||||
|
||||
// Focus our slideout toggle.
|
||||
if ( window.document.documentElement.clientWidth <= 768 ) {
|
||||
if ( body.classList.contains( 'slideout-mobile' ) || body.classList.contains( 'slideout-both' ) ) {
|
||||
document.querySelectorAll( '.main-navigation:not(.slideout-navigation)' ).forEach( function( navigation ) {
|
||||
if ( navigation && navigation.style.display !== 'none' ) {
|
||||
navigation.querySelector( '.menu-toggle' ).focus();
|
||||
}
|
||||
} );
|
||||
}
|
||||
} else {
|
||||
if ( body.classList.contains( 'slideout-desktop' ) || body.classList.contains( 'slideout-both' ) ) {
|
||||
document.querySelectorAll( '.main-navigation:not(.slideout-navigation)' ).forEach( function( navigation ) {
|
||||
if ( navigation && navigation.style.display !== 'none' ) {
|
||||
navigation.querySelector( '.slideout-toggle a' ).focus();
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
@ -631,6 +612,27 @@ document.addEventListener( 'keyup', function( e ) {
|
||||
|
||||
if ( e.keyCode == 27 ) {
|
||||
generateOffside.close();
|
||||
|
||||
var body = document.body;
|
||||
|
||||
// Focus our slideout toggle.
|
||||
if ( window.document.documentElement.clientWidth <= 768 ) {
|
||||
if ( body.classList.contains( 'slideout-mobile' ) || body.classList.contains( 'slideout-both' ) ) {
|
||||
document.querySelectorAll( '.main-navigation:not(.slideout-navigation)' ).forEach( function( navigation ) {
|
||||
if ( navigation && navigation.style.display !== 'none' ) {
|
||||
navigation.querySelector( '.menu-toggle' ).focus();
|
||||
}
|
||||
} );
|
||||
}
|
||||
} else {
|
||||
if ( body.classList.contains( 'slideout-desktop' ) || body.classList.contains( 'slideout-both' ) ) {
|
||||
document.querySelectorAll( '.main-navigation:not(.slideout-navigation)' ).forEach( function( navigation ) {
|
||||
if ( navigation && navigation.style.display !== 'none' ) {
|
||||
navigation.querySelector( '.slideout-toggle a' ).focus();
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user