Skip to content

Commit

Permalink
Remove local_search.trigger option
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed May 7, 2024
1 parent 1ca1077 commit 659e82b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
3 changes: 0 additions & 3 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
11 changes: 1 addition & 10 deletions source/js/third-party/search/local-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 659e82b

Please sign in to comment.