File tree Expand file tree Collapse file tree 2 files changed +3
-15
lines changed Expand file tree Collapse file tree 2 files changed +3
-15
lines changed Original file line number Diff line number Diff line change 1010 min-width : 50px ;
1111}
1212
13- .previous {
14- /*
15- adjust the space between the left sidebar or the left side of the screen
16- and the button that leads to the previous page
17- */
18- margin-left : var (--page-padding );
19- }
20-
2113@media only screen {
2214 @media (max-width : 1179px ) {
2315 .sidebar-hidden # sidetoc {
Original file line number Diff line number Diff line change @@ -71,7 +71,8 @@ function updatePageToc(elem = undefined) {
7171 }
7272}
7373
74- if ( document . getElementById ( "sidetoc" ) === null ) {
74+ if ( document . getElementById ( "sidetoc" ) === null &&
75+ document . getElementsByClassName ( "header" ) . length > 0 ) {
7576 // The sidetoc element doesn't exist yet, let's create it
7677
7778 // Create the empty sidetoc and pagetoc elements
@@ -80,16 +81,11 @@ if (document.getElementById("sidetoc") === null) {
8081 sidetoc . id = "sidetoc" ;
8182 pagetoc . id = "pagetoc" ;
8283 sidetoc . appendChild ( pagetoc ) ;
83-
84+
8485 // And append them to the current DOM
8586 const main = document . querySelector ( 'main' ) ;
8687 main . insertBefore ( sidetoc , main . firstChild ) ;
87- }
8888
89- if ( document . getElementsByClassName ( "header" ) . length <= 1 ) {
90- // There's one or less headings, we don't need a page table of contents
91- document . getElementById ( "sidetoc" ) . remove ( ) ;
92- } else {
9389 // Populate sidebar on load
9490 window . addEventListener ( "load" , ( ) => {
9591 for ( const header of document . getElementsByClassName ( "header" ) ) {
You can’t perform that action at this time.
0 commit comments