mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-11-30 17:14:50 +00:00
perf(core): ⚡️ disable all CSS transition during window resize
This commit is contained in:
parent
1ca49e61cf
commit
10d3c17f18
|
@ -7,6 +7,16 @@
|
|||
*/
|
||||
function enableCssAnimations( document ) {
|
||||
document.documentElement.classList.add( 'citizen-animations-ready' );
|
||||
|
||||
// Disable all CSS transition during resize
|
||||
const onResize = () => {
|
||||
document.documentElement.classList.remove( 'citizen-animations-ready' );
|
||||
};
|
||||
const onResizeEnd = mw.util.debounce( () => {
|
||||
document.documentElement.classList.add( 'citizen-animations-ready' );
|
||||
}, 250 );
|
||||
window.addEventListener( 'resize', onResize );
|
||||
window.addEventListener( 'resize', onResizeEnd );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue