mirror of
https://ghfast.top/https://github.com/zsjy/halo-theme-dream2.0-plus.git
synced 2025-03-15 18:59:40 +08:00
修复搜索输入过快响应内容错误的问题
This commit is contained in:
parent
f3587a32ed
commit
4813634e46
@ -11,6 +11,7 @@
|
||||
<div class="search-box">
|
||||
<script th:inline="javascript">
|
||||
$(function () {
|
||||
let timer
|
||||
var searchForm = document.getElementById('dream-search-form')
|
||||
var target = [[${theme.config.page_config.search.search_target}]]
|
||||
var searchInput = document.getElementById('halo-search-form-text-input')
|
||||
@ -30,7 +31,10 @@
|
||||
})
|
||||
// 监听输入事件
|
||||
searchInput.addEventListener('input', function (event) {
|
||||
findResult(searchInput.value)
|
||||
clearTimeout(timer)
|
||||
timer = setTimeout(function () {
|
||||
findResult(searchInput.value)
|
||||
}, 150)
|
||||
})
|
||||
|
||||
function removeHTMLTags(str) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user