make faction chat display almost work
This commit is contained in:
12
code/idle.js
12
code/idle.js
@ -7,7 +7,9 @@ var idleReset = function (e) {
|
||||
// update immediately when the user comes back
|
||||
if(isIdle()) {
|
||||
window.idleTime = 0;
|
||||
window.requestData();
|
||||
$.each(window._onResumeFunctions, function(ind, f) {
|
||||
f();
|
||||
});
|
||||
}
|
||||
window.idleTime = 0;
|
||||
};
|
||||
@ -16,3 +18,11 @@ $('body').mousemove(idleReset).keypress(idleReset);
|
||||
window.isIdle = function() {
|
||||
return window.idleTime >= MAX_IDLE_TIME;
|
||||
}
|
||||
|
||||
window._onResumeFunctions = [];
|
||||
|
||||
// add your function here if you want to be notified when the user
|
||||
// resumes from being idle
|
||||
window.addResumeFunction = function(f) {
|
||||
window._onResumeFunctions.push(f);
|
||||
}
|
||||
|
Reference in New Issue
Block a user