Skip to content
Snippets Groups Projects
Commit 110749cc authored by Andreas Gohr's avatar Andreas Gohr
Browse files

fixed delay in qsearch

The ajax quicksearch sent a request on every keystroke instead of
waiting for the user to stop typing.
parent 0a9349a6
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,7 @@ var dw_qsearch = {
$inObj: null,
$outObj: null,
timer: null,
/**
* initialize the quick search
......@@ -55,8 +56,12 @@ var dw_qsearch = {
dw_qsearch.$inObj.keyup(
function() {
if(dw_qsearch.timer){
window.clearTimeout(dw_qsearch.timer);
dw_qsearch.timer = null;
}
dw_qsearch.clear_results();
window.setTimeout(do_qsearch, 500);
dw_qsearch.timer = window.setTimeout(do_qsearch, 500);
}
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment