File tree 2 files changed +3
-15
lines changed
2 files changed +3
-15
lines changed Original file line number Diff line number Diff line change 10
10
min-width : 50px ;
11
11
}
12
12
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
-
21
13
@media only screen {
22
14
@media (max-width : 1179px ) {
23
15
.sidebar-hidden # sidetoc {
Original file line number Diff line number Diff line change @@ -71,7 +71,8 @@ function updatePageToc(elem = undefined) {
71
71
}
72
72
}
73
73
74
- if ( document . getElementById ( "sidetoc" ) === null ) {
74
+ if ( document . getElementById ( "sidetoc" ) === null &&
75
+ document . getElementsByClassName ( "header" ) . length > 0 ) {
75
76
// The sidetoc element doesn't exist yet, let's create it
76
77
77
78
// Create the empty sidetoc and pagetoc elements
@@ -80,16 +81,11 @@ if (document.getElementById("sidetoc") === null) {
80
81
sidetoc . id = "sidetoc" ;
81
82
pagetoc . id = "pagetoc" ;
82
83
sidetoc . appendChild ( pagetoc ) ;
83
-
84
+
84
85
// And append them to the current DOM
85
86
const main = document . querySelector ( 'main' ) ;
86
87
main . insertBefore ( sidetoc , main . firstChild ) ;
87
- }
88
88
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 {
93
89
// Populate sidebar on load
94
90
window . addEventListener ( "load" , ( ) => {
95
91
for ( const header of document . getElementsByClassName ( "header" ) ) {
You can’t perform that action at this time.
0 commit comments