v 0.8.14b

This commit is contained in:
Azgaar 2019-05-04 20:12:47 +03:00
parent edc3fc1826
commit f81fd8a94c
8 changed files with 100 additions and 41 deletions

View file

@ -433,4 +433,20 @@ function getAbsolutePath(href) {
var link = document.createElement("a");
link.href = href;
return link.href;
}
}
// from https://davidwalsh.name/javascript-debounce-function
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
if (!immediate) func.apply(context, args);
}
var callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) func.apply(context, args);
}
};