mirror of
https://github.com/kiwix/kiwix-desktop.git
synced 2025-09-22 19:46:12 -04:00
Do not do too many request as we try the search in the contentManager.
Wait 200ms before doing the request. It will avoid contentManager to do too many (and useless) requests.
This commit is contained in:
parent
7b1d302a78
commit
f0e61d31bf
@ -79,6 +79,12 @@ function init() {
|
||||
onBooksChanged();
|
||||
});
|
||||
}
|
||||
|
||||
futurCall = null;
|
||||
function setSearch(value) {
|
||||
clearTimeout(futurCall);
|
||||
futurCall = setTimeout(function(){contentManager.setSearch(value)}, 200);
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
body {
|
||||
@ -172,7 +178,7 @@ details:hover {
|
||||
<div id="app">
|
||||
<div id="searchBar">
|
||||
<form>
|
||||
<input id="searchInput" type="text" placeholder="Search files" oninput="contentManager.setSearch(this.value)"/>
|
||||
<input id="searchInput" type="text" placeholder="Search files" oninput="setSearch(this.value)"/>
|
||||
</form>
|
||||
</div>
|
||||
<div id="bookList">
|
||||
|
Loading…
x
Reference in New Issue
Block a user