Skip to content

Commit

Permalink
Create main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Spacec4t authored Oct 31, 2023
1 parent fd508a0 commit 892c053
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
let timer;

document.addEventListener('visibilitychange', function() {
clearTimeout(timer); // Vorhandenen Timer löschen, wenn der Tab-Status geändert wird

if (document.hidden) {
timer = setTimeout(function() {
document.originalTitle = document.title;
document.title = ittcData.inactiveTitle;
}, ittcData.timeout);
} else {
document.title = document.originalTitle || document.title; // Setze den Titel zurück, falls ein originalTitle vorhanden ist
}
});

0 comments on commit 892c053

Please sign in to comment.