webclient/js/StatusHandler.js

17 lines
279 B
JavaScript

var baseTitle = document.title;
window.addEventListener('focus', reset);
return {
reset: reset,
set: set
};
function reset() {
document.title = baseTitle;
}
function set(newStatus) {
if(!document.hasFocus()) {
document.title = newStatus + " - " + baseTitle;
}
}