add helpKey config item

This commit is contained in:
Cade Scroggins
2022-02-20 14:32:41 -08:00
parent efab31d87d
commit 82d82ae8a5
+8 -1
View File
@@ -6,6 +6,11 @@
<script> <script>
const CONFIG = { const CONFIG = {
/**
* Type this to toggle the help menu.
*/
helpKey: '?',
/** /**
* Action to take when the clock is clicked. Options include: * Action to take when the clock is clicked. Options include:
* *
@@ -1251,6 +1256,7 @@
this._inputEl = $.el('#search-input'); this._inputEl = $.el('#search-input');
this._inputElVal = ''; this._inputElVal = '';
this._instantRedirect = options.instantRedirect; this._instantRedirect = options.instantRedirect;
this._helpKey = options.helpKey;
this._newTab = options.newTab; this._newTab = options.newTab;
this._parseQuery = options.parseQuery; this._parseQuery = options.parseQuery;
this._suggester = options.suggester; this._suggester = options.suggester;
@@ -1287,7 +1293,7 @@
_handleInput() { _handleInput() {
const newQuery = this._inputEl.value; const newQuery = this._inputEl.value;
const isHelp = newQuery === '?'; const isHelp = newQuery === this._helpKey;
const parsedQuery = this._parseQuery(newQuery); const parsedQuery = this._parseQuery(newQuery);
this._inputElVal = newQuery; this._inputElVal = newQuery;
this._suggester.suggest(parsedQuery); this._suggester.suggest(parsedQuery);
@@ -1406,6 +1412,7 @@
}); });
const form = new Form({ const form = new Form({
helpKey: CONFIG.helpKey,
instantRedirect: CONFIG.queryInstantRedirect, instantRedirect: CONFIG.queryInstantRedirect,
newTab: CONFIG.queryNewTab, newTab: CONFIG.queryNewTab,
parseQuery: queryParser.parse, parseQuery: queryParser.parse,