File tree Expand file tree Collapse file tree 3 files changed +43
-7
lines changed Expand file tree Collapse file tree 3 files changed +43
-7
lines changed Original file line number Diff line number Diff line change 16
16
</ header >
17
17
< div class ="container-fluid td-outer ">
18
18
< div class ="td-main ">
19
- < div class ="row flex ">
19
+ < div class ="row flex-column flex-md-row ">
20
20
< div id ="sidebarnav " class ="split td-sidebar d-print-none ">
21
21
{{ partial "sidebar.html" . }}
22
22
</ div >
51
51
{{ partial "disqus-comment.html" . }}
52
52
{{ end }}
53
53
</ main >
54
- < div class ="d-none d-xl-block td-toc d-print-none ">
54
+ < div class ="d-none d-xl-block td-toc d-print-none col-xl-4 ">
55
55
{{ partial "toc.html" . }}
56
56
</ div >
57
57
</ div > <!--end of main-content-->
Original file line number Diff line number Diff line change 14
14
background-image : url ('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==' );
15
15
cursor : col-resize;
16
16
}
17
+
18
+ # sidebarnav ,
19
+ # maindoc {
20
+ max-width : 100% ;
21
+ }
22
+
23
+ # maindoc {
24
+ overflow-wrap : break-word;
25
+ }
26
+
27
+ @media (max-width : 768px ) {
28
+ # sidebarnav {
29
+ padding-left : 15px ;
30
+ padding-right : 15px ;
31
+ }
32
+
33
+ }
17
34
</ style >
18
35
<!--end splitter-->
19
36
Original file line number Diff line number Diff line change 25
25
26
26
<!--for the splitter-->
27
27
< script >
28
- eleNav = document . getElementById ( "sidebarnav" ) ;
28
+ let splitInstance = null ;
29
+
30
+ function enableSplitter ( mediaQuery ) {
31
+ if ( mediaQuery . matches ) {
32
+ if ( ! splitInstance ) {
33
+ splitInstance = Split ( [ "#sidebarnav" , "#maindoc" ] , {
34
+ sizes : [ 20 , 80 ] ,
35
+ minSize : 100 ,
36
+ } ) ;
37
+ }
38
+ } else {
39
+ if ( splitInstance ) {
40
+ splitInstance . destroy ( ) ;
41
+ splitInstance = null ;
42
+ }
43
+ }
44
+ }
45
+
46
+ const screenWidthMediaQuery = window . matchMedia ( "(min-width: 768px)" ) ;
47
+
48
+ const eleNav = document . getElementById ( "sidebarnav" ) ;
29
49
if ( eleNav !== null ) {
30
- Split ( [ "#sidebarnav" , "#maindoc" ] , {
31
- sizes : [ 20 , 80 ] ,
32
- minSize : 100 ,
33
- } ) ;
50
+ enableSplitter ( screenWidthMediaQuery ) ;
51
+ screenWidthMediaQuery . addListener ( enableSplitter ) ;
34
52
}
35
53
</ script >
36
54
55
+
37
56
{{ partial "hooks/body-end.html" . }}
You can’t perform that action at this time.
0 commit comments