Skip to content

Commit

Permalink
fix(core): 馃悰 remove loading indicator when page is unloaded
Browse files Browse the repository at this point in the history
Closes: #811
  • Loading branch information
alistair3149 committed Mar 19, 2024
1 parent a85ecb5 commit 21ce85a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions resources/skins.citizen.scripts/skin.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,9 @@ function main( window ) {
document.documentElement.classList.add( 'citizen-loading' );
}, false );

// Remove loading indicator when user clicks back button
window.addEventListener( 'pageshow', () => {
if ( performance.getEntriesByType( 'navigation' )[ 0 ].type === 'back_forward' ) {
document.documentElement.classList.remove( 'citizen-loading' );
}
// Remove loading indicator once the page is unloaded/hidden
window.addEventListener( 'pagehide', () => {
document.documentElement.classList.remove( 'citizen-loading' );
} );
}

Expand Down

0 comments on commit 21ce85a

Please sign in to comment.