try to fix glitchy buttons

Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
Simon L. 2024-05-15 18:15:34 +02:00
parent 26c042fd28
commit 5a826222d4

View file

@ -1,4 +1,5 @@
if (document.hasFocus()) {
document.addEventListener("DOMContentLoaded", function(event) {
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++) {
@ -10,8 +11,9 @@ if (document.hasFocus()) {
setTimeout(function(){
window.location.reload(1);
}, 5000);
} else {
} else {
window.addEventListener("beforeunload", function() {
document.getElementById('overlay').classList.add('loading')
});
}
}
});