File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 3
3
4
4
activateSearch ( require ( 'docsearch.js/dist/cdn/docsearch.js' ) , document . getElementById ( 'search-script' ) . dataset )
5
5
6
- var CTRL_KEY = 17
7
- var S_KEY = 83
8
- var SOLIDUS_KEY = 191
6
+ var CTRL_KEY_CODE = 17
7
+ var S_KEY_CODE = 83
8
+ var SOLIDUS_KEY_CODE = 191
9
9
10
10
function activateSearch ( docsearch , config ) {
11
11
appendStylesheet ( config . stylesheet )
98
98
function handleShortcuts ( e ) {
99
99
var target = e . target || { }
100
100
if ( e . altKey || e . shiftKey || target . isContentEditable || 'disabled' in target ) return
101
- if ( e . ctrlKey ? e . keyCode === SOLIDUS_KEY : e . keyCode === S_KEY ) {
101
+ if ( e . ctrlKey ? e . keyCode === SOLIDUS_KEY_CODE : e . keyCode === S_KEY_CODE ) {
102
102
this . $input . focus ( )
103
103
e . preventDefault ( )
104
104
e . stopPropagation ( )
111
111
}
112
112
113
113
function onCtrlKeyDown ( e ) {
114
- if ( e . keyCode !== CTRL_KEY ) return
114
+ if ( e . keyCode !== CTRL_KEY_CODE ) return
115
115
var container = this . datasets [ 0 ] . $el
116
116
var prevScrollTop = container . scrollTop ( )
117
117
this . getCurrentCursor ( ) . find ( 'a' ) . focus ( ) // calling focus can cause the container to scroll
118
118
container . scrollTop ( prevScrollTop )
119
119
}
120
120
121
121
function onCtrlKeyUp ( e ) {
122
- if ( e . keyCode === CTRL_KEY ) this . focus ( )
122
+ if ( e . keyCode === CTRL_KEY_CODE ) this . focus ( )
123
123
}
124
124
125
125
function onSuggestionMouseDown ( e ) {
You can’t perform that action at this time.
0 commit comments