mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-19 18:42:34 +00:00
Remove local_search.trigger option
This commit is contained in:
parent
1ca10776ff
commit
659e82b452
@ -863,9 +863,6 @@ algolia_search:
|
|||||||
# Dependencies: https://github.com/next-theme/hexo-generator-searchdb
|
# Dependencies: https://github.com/next-theme/hexo-generator-searchdb
|
||||||
local_search:
|
local_search:
|
||||||
enable: false
|
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
|
# Show top n results per article, show all results by setting to -1
|
||||||
top_n_per_article: 1
|
top_n_per_article: 1
|
||||||
# Unescape html strings to the readable one.
|
# Unescape html strings to the readable one.
|
||||||
|
|||||||
11
source/js/third-party/search/local-search.js
vendored
11
source/js/third-party/search/local-search.js
vendored
@ -51,16 +51,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
localSearch.fetchData();
|
localSearch.fetchData();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CONFIG.localsearch.trigger === 'auto') {
|
input.addEventListener('input', inputEventFunction);
|
||||||
input.addEventListener('input', inputEventFunction);
|
|
||||||
} else {
|
|
||||||
document.querySelector('.search-icon').addEventListener('click', inputEventFunction);
|
|
||||||
input.addEventListener('keypress', event => {
|
|
||||||
if (event.key === 'Enter') {
|
|
||||||
inputEventFunction();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
window.addEventListener('search:loaded', inputEventFunction);
|
window.addEventListener('search:loaded', inputEventFunction);
|
||||||
|
|
||||||
// Handle and trigger popup window
|
// Handle and trigger popup window
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user