Small JS code improvements
This commit is contained in:
parent
082e4ca497
commit
ae93e6e3b8
2 changed files with 5 additions and 6 deletions
|
@ -112,10 +112,6 @@ window.initSearch = function(rawSearchIndex) {
|
||||||
* @type {Array<Row>}
|
* @type {Array<Row>}
|
||||||
*/
|
*/
|
||||||
let searchIndex;
|
let searchIndex;
|
||||||
/**
|
|
||||||
* @type {Array<string>}
|
|
||||||
*/
|
|
||||||
let searchWords = [];
|
|
||||||
let currentResults;
|
let currentResults;
|
||||||
const ALIASES = {};
|
const ALIASES = {};
|
||||||
const params = searchState.getQueryStringParams();
|
const params = searchState.getQueryStringParams();
|
||||||
|
@ -2118,7 +2114,10 @@ window.initSearch = function(rawSearchIndex) {
|
||||||
search(undefined, true);
|
search(undefined, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
searchWords = buildIndex(rawSearchIndex);
|
/**
|
||||||
|
* @type {Array<string>}
|
||||||
|
*/
|
||||||
|
const searchWords = buildIndex(rawSearchIndex);
|
||||||
registerSearchEvents();
|
registerSearchEvents();
|
||||||
|
|
||||||
function runSearchIfNeeded() {
|
function runSearchIfNeeded() {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Local js definitions:
|
|
||||||
/* eslint-env es6 */
|
/* eslint-env es6 */
|
||||||
/* eslint no-var: "error" */
|
/* eslint no-var: "error" */
|
||||||
/* eslint prefer-const: "error" */
|
/* eslint prefer-const: "error" */
|
||||||
|
// Local js definitions:
|
||||||
/* global getSettingValue, getVirtualKey, onEachLazy, updateLocalStorage, updateSystemTheme */
|
/* global getSettingValue, getVirtualKey, onEachLazy, updateLocalStorage, updateSystemTheme */
|
||||||
/* global addClass, removeClass */
|
/* global addClass, removeClass */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue