From f0e61d31bfbabba4ad7089ada4bf0aaccd5420c4 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Mon, 10 Dec 2018 12:51:16 +0100 Subject: [PATCH] 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. --- resources/texts/_contentManager.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/resources/texts/_contentManager.html b/resources/texts/_contentManager.html index ebc98a3..9ced007 100644 --- a/resources/texts/_contentManager.html +++ b/resources/texts/_contentManager.html @@ -79,6 +79,12 @@ function init() { onBooksChanged(); }); } + +futurCall = null; +function setSearch(value) { + clearTimeout(futurCall); + futurCall = setTimeout(function(){contentManager.setSearch(value)}, 200); +}