🐛 fix(search): restore highlighting functionality (#401)
This commit is contained in:
parent
fc04ab4e40
commit
17694ba3d8
@ -2942,13 +2942,13 @@ window.onload = function () {
|
|||||||
searchInput.addEventListener(
|
searchInput.addEventListener(
|
||||||
'input',
|
'input',
|
||||||
async function () {
|
async function () {
|
||||||
const searchInput = this.value;
|
const inputValue = this.value;
|
||||||
const searchTerm = searchInput.trim();
|
const searchTerm = inputValue.trim();
|
||||||
const searchIndex = await searchIndexPromise;
|
const searchIndex = await searchIndexPromise;
|
||||||
results.innerHTML = '';
|
results.innerHTML = '';
|
||||||
|
|
||||||
// Use the raw input so the "clear" button appears even if there's only spaces.
|
// Use the raw input so the "clear" button appears even if there's only spaces.
|
||||||
clearSearchButton.style.display = searchInput.length > 0 ? 'block' : 'none';
|
clearSearchButton.style.display = inputValue.length > 0 ? 'block' : 'none';
|
||||||
resultsContainer.style.display = searchTerm.length > 0 ? 'block' : 'none';
|
resultsContainer.style.display = searchTerm.length > 0 ? 'block' : 'none';
|
||||||
|
|
||||||
// Perform the search and store the results.
|
// Perform the search and store the results.
|
||||||
|
2
static/js/searchElasticlunr.min.js
vendored
2
static/js/searchElasticlunr.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user