mirror of
https://github.com/xvvvyz/tilde.git
synced 2026-03-11 14:44:24 +00:00
add helpKey config item
This commit is contained in:
parent
efab31d87d
commit
82d82ae8a5
1 changed files with 8 additions and 1 deletions
|
|
@ -6,6 +6,11 @@
|
|||
|
||||
<script>
|
||||
const CONFIG = {
|
||||
/**
|
||||
* Type this to toggle the help menu.
|
||||
*/
|
||||
helpKey: '?',
|
||||
|
||||
/**
|
||||
* Action to take when the clock is clicked. Options include:
|
||||
*
|
||||
|
|
@ -1251,6 +1256,7 @@
|
|||
this._inputEl = $.el('#search-input');
|
||||
this._inputElVal = '';
|
||||
this._instantRedirect = options.instantRedirect;
|
||||
this._helpKey = options.helpKey;
|
||||
this._newTab = options.newTab;
|
||||
this._parseQuery = options.parseQuery;
|
||||
this._suggester = options.suggester;
|
||||
|
|
@ -1287,7 +1293,7 @@
|
|||
|
||||
_handleInput() {
|
||||
const newQuery = this._inputEl.value;
|
||||
const isHelp = newQuery === '?';
|
||||
const isHelp = newQuery === this._helpKey;
|
||||
const parsedQuery = this._parseQuery(newQuery);
|
||||
this._inputElVal = newQuery;
|
||||
this._suggester.suggest(parsedQuery);
|
||||
|
|
@ -1406,6 +1412,7 @@
|
|||
});
|
||||
|
||||
const form = new Form({
|
||||
helpKey: CONFIG.helpKey,
|
||||
instantRedirect: CONFIG.queryInstantRedirect,
|
||||
newTab: CONFIG.queryNewTab,
|
||||
parseQuery: queryParser.parse,
|
||||
|
|
|
|||
Loading…
Reference in a new issue