fix navbar & path highlighting

This commit is contained in:
2023-06-17 15:04:57 +02:00
parent 1b794e0742
commit 2d6911b324
26 changed files with 436 additions and 265 deletions

View File

@@ -30,10 +30,15 @@
} else {
$( '.nav-wrapper' ).css( 'display', 'none' );
}
if ( location.pathname === '/' ) {
$( '#home' ).removeClass( 'inactive' );
} else {
} else if( !location.pathname.substring( 1, location.pathname.length - 1 ).includes( '/' ) ) {
$( '#' + location.pathname.slice( 1, location.pathname.length - 1 ) ).removeClass( 'inactive' );
} else if ( location.pathname.slice( 1, location.pathname.substring( 1 ).indexOf( '/' ) + 1 ) === 'docs' ) {
$( '#docs' ).removeClass( 'inactive' );
} else {
console.error( 'an error occurred whilst highlighting the path' );
}
sessionStorage.setItem( 'menuOpen', 'false' );
} );