Remove local_search.trigger option

This commit is contained in:
Mimi 2024-05-07 16:43:50 +08:00
parent 1ca10776ff
commit 659e82b452
2 changed files with 1 additions and 13 deletions

View File

@ -863,9 +863,6 @@ algolia_search:
# Dependencies: https://github.com/next-theme/hexo-generator-searchdb
local_search:
enable: false
# If auto, trigger search by changing input.
# If manual, trigger search by pressing enter key or search button.
trigger: auto
# Show top n results per article, show all results by setting to -1
top_n_per_article: 1
# Unescape html strings to the readable one.

View File

@ -51,16 +51,7 @@ document.addEventListener('DOMContentLoaded', () => {
localSearch.fetchData();
}
if (CONFIG.localsearch.trigger === 'auto') {
input.addEventListener('input', inputEventFunction);
} else {
document.querySelector('.search-icon').addEventListener('click', inputEventFunction);
input.addEventListener('keypress', event => {
if (event.key === 'Enter') {
inputEventFunction();
}
});
}
input.addEventListener('input', inputEventFunction);
window.addEventListener('search:loaded', inputEventFunction);
// Handle and trigger popup window