This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-28
lines changed Expand file tree Collapse file tree 2 files changed +6
-28
lines changed Original file line number Diff line number Diff line change 1919}
2020
2121@media only screen {
22- main {
23- display : -webkit-box;
24- display : -ms-flexbox;
25- display : flex;
26- }
27-
2822 @media (max-width : 1179px ) {
2923 .sidebar-hidden # sidetoc {
3024 display : none;
5145 }
5246 }
5347
54- .content-wrap {
55- width : 100% ;
56- }
57-
5848 # sidetoc {
59- margin-top : 20px ;
60- margin-left : 20px ;
61- margin-right : auto;
49+ margin-left : calc (100% + 20px );
6250 }
6351 # pagetoc {
6452 position : fixed;
Original file line number Diff line number Diff line change @@ -72,28 +72,18 @@ function updatePageToc(elem = undefined) {
7272}
7373
7474if ( document . getElementById ( "sidetoc" ) === null ) {
75- // Element doesn't exist yet, let's create it
76- const main = document . querySelector ( 'main' ) ;
77- const wrapper = document . createElement ( 'div' ) ;
78- wrapper . className = "content-wrap" ;
79-
80- // Move all children into the wrapper
81- while ( main . firstChild ) {
82- wrapper . appendChild ( main . firstChild ) ;
83- }
84-
85- // Append the wrapper back to main
86- main . appendChild ( wrapper ) ;
75+ // The sidetoc element doesn't exist yet, let's create it
8776
8877 // Create the empty sidetoc and pagetoc elements
8978 const sidetoc = document . createElement ( "div" ) ;
9079 const pagetoc = document . createElement ( "div" ) ;
9180 sidetoc . id = "sidetoc" ;
9281 pagetoc . id = "pagetoc" ;
93-
94- // And append them to the current DOM
9582 sidetoc . appendChild ( pagetoc ) ;
96- main . appendChild ( sidetoc ) ;
83+
84+ // And append them to the current DOM
85+ const main = document . querySelector ( 'main' ) ;
86+ main . insertBefore ( sidetoc , main . firstChild ) ;
9787}
9888
9989if ( document . getElementsByClassName ( "header" ) . length <= 1 ) {
You can’t perform that action at this time.
0 commit comments