clause agent mode "make it look like papermod"
This commit is contained in:
parent
1c59bd66ea
commit
582e4491c0
91 changed files with 2139 additions and 202 deletions
9
js/navigation.js
Normal file → Executable file
9
js/navigation.js
Normal file → Executable file
|
@ -27,13 +27,14 @@
|
|||
return;
|
||||
}
|
||||
|
||||
if ( ! menu.classList.contains( 'nav-menu' ) ) {
|
||||
menu.classList.add( 'nav-menu' );
|
||||
// Add primary-menu class if it doesn't exist
|
||||
if ( ! menu.classList.contains( 'primary-menu' ) ) {
|
||||
menu.classList.add( 'primary-menu' );
|
||||
}
|
||||
|
||||
// Toggle the .toggled class and the aria-expanded value each time the button is clicked.
|
||||
button.addEventListener( 'click', function() {
|
||||
siteNavigation.classList.toggle( 'toggled' );
|
||||
menu.classList.toggle( 'toggled' );
|
||||
|
||||
if ( button.getAttribute( 'aria-expanded' ) === 'true' ) {
|
||||
button.setAttribute( 'aria-expanded', 'false' );
|
||||
|
@ -47,7 +48,7 @@
|
|||
const isClickInside = siteNavigation.contains( event.target );
|
||||
|
||||
if ( ! isClickInside ) {
|
||||
siteNavigation.classList.remove( 'toggled' );
|
||||
menu.classList.remove( 'toggled' );
|
||||
button.setAttribute( 'aria-expanded', 'false' );
|
||||
}
|
||||
} );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue