mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 04:12:59 +00:00
Delay DataTables search by 200ms (references #424)
This commit is contained in:
@@ -129,3 +129,19 @@ function IsJsonString(text)
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function Delay(callable, delayMilliseconds)
|
||||
{
|
||||
var timer = 0;
|
||||
return function()
|
||||
{
|
||||
var context = this;
|
||||
var args = arguments;
|
||||
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(function()
|
||||
{
|
||||
callable.apply(context, args);
|
||||
}, delayMilliseconds || 0);
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user