mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-09 06:46:08 -06:00
commit
a4b2840c78
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 */
|
(function (window, document) {
|
||||||
window.addEventListener('offline', () => {
|
|
||||||
$('body > *').hide();
|
|
||||||
$('#offline').show();
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#offline button').click(function () {
|
// Go!
|
||||||
$('.spinner-border', this).css('display', 'inline-block')
|
|
||||||
|
|
||||||
setTimeout(() => {
|
})(window, document);
|
||||||
if (window.navigator.onLine) {
|
|
||||||
window.location.reload();
|
|
||||||
} else {
|
|
||||||
$('.spinner-border', this).hide()
|
|
||||||
}
|
|
||||||
}, 250)
|
|
||||||
})
|
|
||||||
/* End Offline */
|
|
||||||
|
|||||||
@ -20,6 +20,7 @@
|
|||||||
{{ asset_add("theme.js", "visiosoft.theme.base::js/theme/initialize.js") }}
|
{{ 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/search.js") }}
|
||||||
{{ asset_add("theme.js", "visiosoft.theme.base::js/theme/modal.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") }}
|
{{ asset_script("theme.js") }}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user