mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
#4306 offline error
This commit is contained in:
parent
cbe7a39774
commit
7b133a8459
18
addons/default/visiosoft/base-theme/resources/js/offline.js
Normal file
18
addons/default/visiosoft/base-theme/resources/js/offline.js
Normal 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 */
|
||||
@ -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);
|
||||
|
||||
@ -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") }}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user