mediawiki-skins-MinervaNeue/resources/skins.minerva.scripts/menu.js
Fomafix effd4fe133 Use eslint rule "no-var": "error" and replace all var
Change-Id: I67acf88e1b8de55054248d7cf8ca622d5772ea6f
2024-03-29 07:40:22 +00:00

24 lines
622 B
JavaScript

const BODY_NOTIFICATIONS_REVEAL_CLASS = 'navigation-enabled secondary-navigation-enabled';
/**
* Wire up the main menu
*/
function init() {
// See I09c27a084100b223662f84de6cbe01bebe1fe774
// will trigger every time the Echo notification is opened or closed.
// This controls the drawer like behaviour of notifications
// on tablet in mobile mode.
mw.hook( 'echo.mobile' ).add( function ( isOpen ) {
if ( isOpen ) {
$( document.body ).addClass( BODY_NOTIFICATIONS_REVEAL_CLASS );
} else {
$( document.body ).removeClass( BODY_NOTIFICATIONS_REVEAL_CLASS );
}
} );
}
module.exports = {
init: init
};