@@ -8,18 +8,6 @@ $(function(){
8
8
$ ( ".slide" ) . toggleClass ( "hidden" ) ;
9
9
} ) ;
10
10
11
-
12
- // "?" Help menu
13
- var help = { } ;
14
- help . toggle = function ( event ) {
15
- if ( event . shiftKey && event . keyCode === 191 ) {
16
- $ ( '#help' ) . modal ( 'toggle' ) ;
17
- }
18
- } ;
19
-
20
- document . addEventListener ( "keydown" , help . toggle , false ) ;
21
-
22
-
23
11
// Parse username from querystring
24
12
var urlSearch = window . location . search ,
25
13
teacherQuery = urlSearch . match ( / t e a c h e r = [ a - z , A - Z , 0 - 9 ] * / ) ,
@@ -111,14 +99,21 @@ $(function(){
111
99
}
112
100
113
101
// Bind checkbox toggle for TOC
114
- var toc = { } ;
115
- toc . toggle = function ( event ) {
116
- if ( event . shiftKey && event . keyCode === 84 ) {
102
+ var shortcuts = { } ;
103
+ shortcuts . toggle = function ( event ) {
104
+ console . log ( event . keyCode ) ;
105
+
106
+ // Help "?" toggle
107
+ if ( event . shiftKey && event . keyCode === 191 ) {
108
+ $ ( '#help' ) . modal ( 'toggle' ) ;
109
+ }
110
+ // TOC "T" toggle
111
+ else if ( event . shiftKey && event . keyCode === 84 ) {
117
112
$ ( ".col-content" ) . toggleClass ( "shift-left" ) ;
118
113
$ ( ".col-toc" ) . toggleClass ( "shift-left" ) ;
119
114
}
120
115
}
121
- document . addEventListener ( "keydown" , toc . toggle , false ) ;
116
+ document . addEventListener ( "keydown" , shortcuts . toggle , false ) ;
122
117
123
118
// Render the TOC
124
119
buildToc ( ) ;
0 commit comments