mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-12-21 01:52:49 +00:00
3c5edfa5cd
Now the main menu is not using JavaScript we can simplify the menu code to apply only to the Echo navigation drawer. Bug: T225213 Change-Id: If4831fc700c7df3a2a389b5f95b6fbaea4b7d954
24 lines
620 B
JavaScript
24 lines
620 B
JavaScript
var 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
|
|
};
|