updated plugin GP Premium version 2.2.2

This commit is contained in:
2022-12-19 23:08:15 +00:00
committed by Gitium
parent 4657b9b202
commit dcc5b4d910
4 changed files with 28 additions and 23 deletions

View File

@ -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