Support overriding search key

This commit is contained in:
Daniel Vainsencher 2021-05-30 23:02:57 -07:00 committed by GitHub
parent 8201b411ab
commit 87c8382daf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -25,6 +25,7 @@ window.search = window.search || {};
searchresults_header = document.getElementById('searchresults-header'), searchresults_header = document.getElementById('searchresults-header'),
searchicon = document.getElementById('search-toggle'), searchicon = document.getElementById('search-toggle'),
content = document.getElementById('content'), content = document.getElementById('content'),
search_key_override = document.getElementById('search-key-override-keycode'),
searchindex = null, searchindex = null,
doc_urls = [], doc_urls = [],
@ -48,7 +49,11 @@ window.search = window.search || {};
URL_MARK_PARAM = 'highlight', URL_MARK_PARAM = 'highlight',
teaser_count = 0, teaser_count = 0,
SEARCH_HOTKEY_KEYCODE = 83, if (search_key_override != null) {
SEARCH_HOTKEY_KEYCODE = search_key_override,
} else {
SEARCH_HOTKEY_KEYCODE = 83,
}
ESCAPE_KEYCODE = 27, ESCAPE_KEYCODE = 27,
DOWN_KEYCODE = 40, DOWN_KEYCODE = 40,
UP_KEYCODE = 38, UP_KEYCODE = 38,