@@ -6,13 +6,20 @@ import { expandCollapseComponent } from './endpoint-template.js';
66import { getComponentInfo } from './components-template.js' ;
77
88function onExpandCollapseTag ( event , tagId ) {
9+ if ( tagId === 'link-overview' ) {
10+ this . resolvedSpec . info . expanded = ! this . resolvedSpec . info . expanded ;
11+ this . scrollToEventTarget ( event , false ) ;
12+ return ;
13+ }
14+
915 const tag = this . resolvedSpec . tags . find ( t => t . elementId === tagId ) ;
1016 if ( ! tag ) {
1117 return ;
1218 }
1319 tag . expanded = ! tag . expanded ;
1420 if ( tag . expanded && this . operationsCollapsed ) {
1521 this . resolvedSpec . tags . filter ( t => t . elementId !== tagId ) . forEach ( t => t . expanded = false ) ;
22+ this . resolvedSpec . info . expanded = false ;
1623 }
1724
1825 // Only display the dedicated tag page if the tag has a description, otherwise, it will be an ugly page with nothing on it.
@@ -62,10 +69,32 @@ export default function navbarTemplate() {
6269 ${ html `< nav class ='nav-scroll ' part ="navbar-scroll ">
6370 ${ ( this . hideInfo || ! this . resolvedSpec . info )
6471 ? ''
65- : html `< div class ='nav-bar-info ' id ='link-overview ' data-content-id ='overview ' @click = '${ ( e ) => this . scrollToEventTarget ( e , false ) } ' role ="link " tabindex ="0 " @keydown = '${ ( e ) => { if ( e . key === 'Enter' ) { e . target . click ( ) ; } } } ';
66- } >
67- ${ this . resolvedSpec . info . title || getI18nText ( 'menu.overview' ) }
68- </ div > `
72+ : html `
73+ < div class ='nav-bar-tag-and-paths ${ this . resolvedSpec . info . expanded ? '' : 'collapsed' } '>
74+ < div class ='nav-bar-info ' id ='link-overview ' data-content-id ='overview '
75+ @click = '${ ( e ) => { onExpandCollapseTag . call ( this , e , 'link-overview' ) ; } } '
76+ role ="link " tabindex ="0 "
77+ @keydown = '${ ( e ) => { if ( e . key === 'Enter' ) { e . target . click ( ) ; } } } ';
78+ } >
79+ ${ this . resolvedSpec . info . title || getI18nText ( 'menu.overview' ) }
80+ </ div >
81+
82+ < div class ="nav-bar-section-wrapper ">
83+ < div >
84+ ${ this . resolvedSpec . info . headers ?. map ( ( header ) => html `
85+ < div
86+ class ='nav-bar-h ${ header . depth } '
87+ id ="link-overview-- ${ new marked . Slugger ( ) . slug ( header . text ) } "
88+ data-content-id ='overview-- ${ new marked . Slugger ( ) . slug ( header . text ) } '
89+ @click ='${ ( e ) => this . scrollToEventTarget ( e , false ) } '>
90+ ${ header . text }
91+ </ div > `
92+ ) || '' }
93+ </ div >
94+ </ div >
95+ </ div >
96+
97+ `
6998 }
7099
71100 ${ this . hideServerSelection
0 commit comments