all-in-one/php/public/automatic_reload.js
Simon L cbd86136cc Move vars to lets and fix some things with recording.conf
Signed-off-by: Simon L <szaimen@e.mail.de>
2023-06-06 11:27:52 +02:00

17 lines
No EOL
545 B
JavaScript

if (document.hasFocus()) {
// hide reload button if the site reloads automatically
let list = document.getElementsByClassName("reload button");
for (let i = 0; i < list.length; i++) {
// list[i] is a node with the desired class name
list[i].style.display = 'none';
}
// set timeout for reload
setTimeout(function(){
window.location.reload(1);
}, 5000);
} else {
window.addEventListener("beforeunload", function() {
document.getElementById('overlay').classList.add('loading')
});
}