mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-05-29 15:00:09 +00:00
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: szaimen <42591237+szaimen@users.noreply.github.com>
23 lines
781 B
JavaScript
23 lines
781 B
JavaScript
// SPDX-FileCopyrightText: 2022 Nextcloud GmbH <https://nextcloud.com>
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
window.addEventListener("load", 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++) {
|
|
// list[i] is a node with the desired class name
|
|
list[i].style.display = 'none';
|
|
}
|
|
|
|
// set timeout for reload
|
|
setTimeout(function(){
|
|
window.location.reload(true);
|
|
}, 5000);
|
|
} else {
|
|
window.addEventListener("beforeunload", function() {
|
|
document.getElementById('overlay').classList.add('loading')
|
|
});
|
|
}
|
|
});
|