mirror of
https://github.com/a2nt/webpack-bootstrap-ui-kit.git
synced 2024-10-22 11:05:45 +02:00
IMPR: Show spinner on page unload
This commit is contained in:
parent
99e5e666d1
commit
2342f7347a
@ -58,6 +58,13 @@ const MainUI = ((window) => {
|
||||
// const ui = this
|
||||
console.log(`${NAME}: loaded`)
|
||||
}
|
||||
|
||||
static unloaded () {
|
||||
console.log(`${NAME}: unloaded`)
|
||||
|
||||
SpinnerUI.show()
|
||||
BODY.classList.remove('loaded')
|
||||
}
|
||||
}
|
||||
|
||||
const documentInit = () => {
|
||||
@ -66,12 +73,6 @@ const MainUI = ((window) => {
|
||||
BODY.classList.add('loaded')
|
||||
SpinnerUI.hide()
|
||||
|
||||
window.addEventListener('beforeunload', () => {
|
||||
console.log(`${NAME} before unload`)
|
||||
SpinnerUI.show()
|
||||
BODY.classList.remove('loaded')
|
||||
})
|
||||
|
||||
console.groupEnd('init')
|
||||
console.timeEnd('init')
|
||||
|
||||
@ -90,6 +91,10 @@ const MainUI = ((window) => {
|
||||
MainUI.loaded()
|
||||
})
|
||||
|
||||
window.addEventListener('beforeunload', () => {
|
||||
MainUI.unloaded()
|
||||
})
|
||||
|
||||
window.MainUI = MainUI
|
||||
|
||||
return MainUI
|
||||
|
Loading…
Reference in New Issue
Block a user