chore: reduce debounce time
parent
08de0ad10c
commit
f0967b7072
|
@ -146,7 +146,7 @@ const debounce = (callback, wait) => {
|
||||||
DeclarationDataCenter.init()
|
DeclarationDataCenter.init()
|
||||||
.then((dataCenter) => {
|
.then((dataCenter) => {
|
||||||
// Search autocompletion.
|
// Search autocompletion.
|
||||||
SEARCH_INPUT.addEventListener("input", debounce(ev => handleSearch(dataCenter, null, ev, ac_results, AC_MAX_RESULTS, true), 500));
|
SEARCH_INPUT.addEventListener("input", debounce(ev => handleSearch(dataCenter, null, ev, ac_results, AC_MAX_RESULTS, true), 300));
|
||||||
if(SEARCH_PAGE_INPUT) {
|
if(SEARCH_PAGE_INPUT) {
|
||||||
SEARCH_PAGE_INPUT.addEventListener("input", ev => handleSearch(dataCenter, null, ev, SEARCH_RESULTS, SEARCH_PAGE_MAX_RESULTS, false))
|
SEARCH_PAGE_INPUT.addEventListener("input", ev => handleSearch(dataCenter, null, ev, SEARCH_RESULTS, SEARCH_PAGE_MAX_RESULTS, false))
|
||||||
document.querySelectorAll(".kind_checkbox").forEach((checkbox) =>
|
document.querySelectorAll(".kind_checkbox").forEach((checkbox) =>
|
||||||
|
@ -157,7 +157,7 @@ DeclarationDataCenter.init()
|
||||||
SEARCH_INPUT.dispatchEvent(new Event("input"))
|
SEARCH_INPUT.dispatchEvent(new Event("input"))
|
||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
SEARCH_INPUT.addEventListener("input", debounce(ev => handleSearch(null, e, ev, ac_results, AC_MAX_RESULTS, true), 500));
|
SEARCH_INPUT.addEventListener("input", debounce(ev => handleSearch(null, e, ev, ac_results, AC_MAX_RESULTS, true), 300));
|
||||||
if(SEARCH_PAGE_INPUT) {
|
if(SEARCH_PAGE_INPUT) {
|
||||||
SEARCH_PAGE_INPUT.addEventListener("input", ev => handleSearch(null, e, ev, SEARCH_RESULTS, SEARCH_PAGE_MAX_RESULTS, false));
|
SEARCH_PAGE_INPUT.addEventListener("input", ev => handleSearch(null, e, ev, SEARCH_RESULTS, SEARCH_PAGE_MAX_RESULTS, false));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue