File tree Expand file tree Collapse file tree 3 files changed +10
-47
lines changed Expand file tree Collapse file tree 3 files changed +10
-47
lines changed Original file line number Diff line number Diff line change @@ -100,11 +100,14 @@ $(function(){
100
100
}
101
101
102
102
// Bind checkbox toggle for TOC
103
- $ ( ".toc-toggle-check" ) . change ( function ( ) {
104
- console . log ( "shiftleft on both." ) ;
105
- $ ( ".col-content" ) . toggleClass ( "shift-left" ) ;
106
- $ ( ".col-toc" ) . toggleClass ( "shift-left" ) ;
107
- } ) ;
103
+ var toc = { } ;
104
+ toc . toggle = function ( event ) {
105
+ if ( event . shiftKey && event . keyCode === 84 ) {
106
+ $ ( ".col-content" ) . toggleClass ( "shift-left" ) ;
107
+ $ ( ".col-toc" ) . toggleClass ( "shift-left" ) ;
108
+ }
109
+ }
110
+ document . addEventListener ( "keydown" , toc . toggle , false ) ;
108
111
109
112
// Render the TOC
110
113
buildToc ( ) ;
Original file line number Diff line number Diff line change 18
18
</ div >
19
19
</ div >
20
20
21
-
22
- < div id ="toc-toggle ">
23
- < input type ="checkbox " class ="toc-toggle-check " id ="toc-toggle-check " name ="toc-toggle-check " value ="true " checked ="checked ">
24
- < label class ="toc-toggle-label " for ="toc-toggle-check ">
25
- < span class ="octicon octicon-list-unordered "> </ span >
26
- <!-- <span class="toc-header">Table of Contents</span> -->
27
- </ label >
28
- </ div >
29
-
30
21
< div class ="col-content deck col-md-12 col-sm-12 col-xs-12 materials curriculum shift-left ">
31
22
< div id ="teacher " class ="hidden ">
32
23
< div class ="alignment ">
74
65
< div class ="col-toc col-md-2 col-sm-2 col-xs-2 shift-left ">
75
66
< div id ="toc-wrapper ">
76
67
< div id ="toc " data-spy ="affix " data-offset-top ="145 ">
68
+ < h4 > Table of Contents</ h4 >
77
69
< ul id ="toc-list " class ="nav nav-pills nav-stacked " role ="tablist ">
78
70
< li > </ li >
79
71
</ ul >
Original file line number Diff line number Diff line change @@ -42,38 +42,6 @@ table{
42
42
}
43
43
}
44
44
45
- #toc-toggle {
46
- position : fixed ;
47
- top : 15px ;
48
- right : 24px ;
49
- padding : 0 ;
50
- margin : 0 ;
51
- z-index :1000 ;
52
- }
53
- .toc-toggle-check {
54
- visibility : hidden ;
55
- width : 0 ;
56
- height : 0 ;
57
-
58
- & + .toc-toggle-label {
59
- color : $gray-darker ;
60
- opacity : .3 ;
61
-
62
- .toc-header {
63
- margin-left : 1em ;
64
- display : none ;
65
- }
66
- }
67
-
68
- & :checked + .toc-toggle-label {
69
- opacity : 1 ;
70
- // right: 16.66667%;
71
-
72
- .toc-header {
73
- display : inline ;
74
- }
75
- }
76
- }
77
45
78
46
#toc-wrapper {
79
47
opacity : .5 ;
@@ -361,7 +329,7 @@ table{
361
329
}
362
330
363
331
.affix {
364
- margin-top : -130 px ;
332
+ margin-top : -165 px ;
365
333
position : fixed ;
366
334
}
367
335
You can’t perform that action at this time.
0 commit comments