fix: Replace window.onload with addEventListener for better event handling and hide spinner in skeleton functions

This commit is contained in:
Jokob @NetAlertX
2026-06-20 12:08:48 +00:00
parent 36a10fb9ef
commit 6194134cd0
5 changed files with 9 additions and 5 deletions

View File

@@ -261,7 +261,7 @@ function hideEventsSkeleton() {
$('#events-skeleton').fadeOut(250, function () { $(this).remove(); });
}
window.onload = function () {
window.addEventListener('load', function () {
setTimeout(hideEventsSkeleton, 15000);
};
});
</script>

View File

@@ -294,6 +294,8 @@ async function getData() {
generateTabs();
} catch (err) {
console.error("Failed to load data", err);
hideSpinner();
hidePluginsSkeleton();
}
}
@@ -865,7 +867,7 @@ function hidePluginsSkeleton() {
}
window.addEventListener('load', function() {
setTimeout(hidePluginsSkeleton, 15000);
setTimeout(function() { hidePluginsSkeleton(); hideSpinner(); }, 15000);
});
</script>

View File

@@ -510,6 +510,7 @@ function getDevicesPresence (status) {
};
function hidePresenceSkeleton() {
hideSpinner();
$('#presence-skeleton').fadeOut(250, function() { $(this).remove(); });
}

View File

@@ -221,9 +221,9 @@ function hideNotificationsSkeleton() {
$('#notifications-skeleton').fadeOut(250, function () { $(this).remove(); });
}
window.onload = function () {
window.addEventListener('load', function () {
setTimeout(hideNotificationsSkeleton, 15000);
};
});
</script>

View File

@@ -1378,6 +1378,7 @@ $(document).ready(function () {
});
function hideWorkflowsSkeleton() {
hideSpinner();
$('#workflows-skeleton').fadeOut(250, function() { $(this).remove(); });
}