jquery.idle.js: fix keepTracking option

(imported from commit 327a1c128a88e2e7fcfe7654c6c2c0c67dac0f27)
This commit is contained in:
Zev Benjamin
2012-10-30 16:57:10 -04:00
parent f58898fba7
commit 71a2cc6611

View File

@@ -70,8 +70,14 @@
idle = true;
cancel();
settings.onIdle.call();
if(settings.keepTracking){
timerId = createTimeout(settings);
if(settings.keepTracking) {
// We want the reset to occur after this event has been
// completely handled
setTimeout(function () {
elem.on(settings.events, handler);
canceled = false;
createTimeout(settings);
}, 0);
}
}, settings.idle);
control.timerId = timerId;