#4306 offline error

This commit is contained in:
diashalabi 2021-07-06 15:39:21 +03:00
parent cbe7a39774
commit 7b133a8459
3 changed files with 22 additions and 16 deletions

View File

@ -0,0 +1,18 @@
/* Offline */
window.addEventListener('offline', () => {
$('body > *').hide();
$('#offline').show();
});
$('#offline button').click(function () {
$('.spinner-border', this).css('display', 'inline-block')
setTimeout(() => {
if (window.navigator.onLine) {
window.location.reload();
} else {
$('.spinner-border', this).hide()
}
}, 250)
})
/* End Offline */

View File

@ -1,18 +1,5 @@
/* Offline */
window.addEventListener('offline', () => {
$('body > *').hide();
$('#offline').show();
});
(function (window, document) {
$('#offline button').click(function () {
$('.spinner-border', this).css('display', 'inline-block')
// Go!
setTimeout(() => {
if (window.navigator.onLine) {
window.location.reload();
} else {
$('.spinner-border', this).hide()
}
}, 250)
})
/* End Offline */
})(window, document);

View File

@ -20,6 +20,7 @@
{{ asset_add("theme.js", "visiosoft.theme.base::js/theme/initialize.js") }}
{{ asset_add("theme.js", "visiosoft.theme.base::js/theme/search.js") }}
{{ asset_add("theme.js", "visiosoft.theme.base::js/theme/modal.js") }}
{{ asset_add("theme.js", "visiosoft.theme.base::js/offline.js") }}
{{ asset_script("theme.js") }}