Add session timeout warning

This commit is contained in:
Khanh Ngo
2019-12-17 23:46:34 +07:00
parent ea8531dd3c
commit 9a1b92fbc2
6 changed files with 170 additions and 43 deletions

View File

@ -268,3 +268,20 @@ json_library = {
.replace(jsonLine, json_library.replacer);
}
};
// set count down in second on an element
function timer(elToUpdate, maxTime) {
elToUpdate.text(maxTime + "s");
var interval = setInterval(function () {
if (maxTime > 0) {
maxTime--;
elToUpdate.text(maxTime + "s");
}
else {
clearInterval(interval);
}
}, 1000);
return interval;
}