renamed this var. #359
This commit is contained in:
parent
de867bbba1
commit
3b55a65c4d
@ -195,17 +195,17 @@
|
|||||||
*
|
*
|
||||||
* @param quietMillis number of milliseconds to wait before invoking fn
|
* @param quietMillis number of milliseconds to wait before invoking fn
|
||||||
* @param fn function to be debounced
|
* @param fn function to be debounced
|
||||||
* @param thisobj object to be used as this reference within fn
|
* @param ctx object to be used as this reference within fn
|
||||||
* @return debounced version of fn
|
* @return debounced version of fn
|
||||||
*/
|
*/
|
||||||
function debounce(quietMillis, fn, thisobj) {
|
function debounce(quietMillis, fn, ctx) {
|
||||||
thisobj = thisobj || undefined;
|
ctx = ctx || undefined;
|
||||||
var timeout;
|
var timeout;
|
||||||
return function () {
|
return function () {
|
||||||
var args = arguments;
|
var args = arguments;
|
||||||
window.clearTimeout(timeout);
|
window.clearTimeout(timeout);
|
||||||
timeout = window.setTimeout(function() {
|
timeout = window.setTimeout(function() {
|
||||||
fn.apply(thisobj, args);
|
fn.apply(ctx, args);
|
||||||
}, quietMillis);
|
}, quietMillis);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user