webclient/js/StatusHandler.js

18 lines
279 B
JavaScript
Raw Permalink Normal View History

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;
}
}