File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,8 @@ var siteConfig = {
2828 // we get an error without this, here, though
2929 "steal-stache" : "^4.0.1" ,
3030 "steal-conditional" : "^0.3.6" ,
31- "bit-docs-html-codepen-link" : "^1.0.0"
31+ "bit-docs-html-codepen-link" : "^1.0.0" ,
32+ "bit-docs-html-toc" : "^1.1.1"
3233 } ,
3334 staticDist : [
3435 path . join ( __dirname , "dist" , "static" )
Original file line number Diff line number Diff line change @@ -156,6 +156,18 @@ function init() {
156156 sidebarViewModel . selectedPageName = window . docObject . name ;
157157 }
158158
159+ // Set up the client-side TOC
160+ var tocContainer = document . querySelector ( "#scroll-toc" ) ;
161+ var oldToc = document . querySelector ( "bit-toc" ) ;
162+ if ( oldToc ) {
163+ tocContainer . removeChild ( oldToc ) ;
164+ }
165+ var newToc = document . createElement ( "bit-toc" ) ;
166+ newToc . depth = window . docObject . outline ;
167+ newToc . headingContainerSelector = "#right > article" ;
168+ newToc . scrollSelector = "#scroll-toc" ;
169+ tocContainer . appendChild ( newToc ) ;
170+
159171 hasShownSearch = true ;
160172}
161173
Original file line number Diff line number Diff line change 2222 { {/with} }
2323
2424 </div >
25+ <div class =" column" id =" scroll-toc" >
26+ </div >
2527</div >
You can’t perform that action at this time.
0 commit comments