Skip to content

Commit

Permalink
Docs: Ensure navigation links are properly selected. (#22057)
Browse files Browse the repository at this point in the history
* Docs: Ensure navigation links are properly selected.

* Docs: Simplify code.
  • Loading branch information
Mugen87 authored Jun 29, 2021
1 parent dd6ab3c commit bb51c8f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ <h1><a href="https://threejs.org">three.js</a></h1>
}

const localList = list[ language ];
const selectedPage = window.location.hash.substring( 1 );

for ( const section in localList ) {

Expand Down Expand Up @@ -279,6 +280,14 @@ <h1><a href="https://threejs.org">three.js</a></h1>
const linkElement = createLink( pageName, pageURL );
listElement.appendChild( linkElement );

// select current page

if ( pageURL === selectedPage ) {

linkElement.classList.add( 'selected' );

}

// Gather the main properties for the current subpage

pageProperties[ pageName ] = {
Expand Down

0 comments on commit bb51c8f

Please sign in to comment.