Add 200ms timeout before filtering while you type your query.

This commit is contained in:
voussoir 2020-08-27 17:11:52 -07:00
parent 7b197c867b
commit 25a611e39e

View file

@ -327,9 +327,14 @@ function refresh_channel_callback(response)
} }
var search_filter_box = document.getElementById("search_filter"); var search_filter_box = document.getElementById("search_filter");
var search_filter_wait_for_typing;
var search_filter_hook = function(event) var search_filter_hook = function(event)
{ {
clearTimeout(search_filter_wait_for_typing);
search_filter_wait_for_typing = setTimeout(function()
{
filter_video_cards(search_filter_box.value); filter_video_cards(search_filter_box.value);
}, 200);
} }
search_filter_box.addEventListener("keyup", search_filter_hook); search_filter_box.addEventListener("keyup", search_filter_hook);