Merge pull request #1109 from openclassify/dia

#4306 offline error
This commit is contained in:
spektra2147 2021-07-06 16:08:56 +03:00 committed by GitHub
commit a4b2840c78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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") }}