mediawiki-skins-MinervaNeue/resources/skins.minerva.scripts/menu.js
libraryupgrader 842a91590a build: Updating npm dependencies
* eslint-config-wikimedia: 0.27.0 → 0.28.2
  The following rules are failing and were disabled:
  * tests/selenium:
    * implicit-arrow-linebreak
    * no-mixed-spaces-and-tabs
* grunt-banana-checker: 0.11.1 → 0.13.0
* stylelint-config-wikimedia: 0.16.1 → 0.17.2
  The following rules no longer exist and were removed:
  * stylistic/selector-list-comma-newline-after
* braces: 3.0.2 → 3.0.3
  * https://github.com/advisories/GHSA-grv7-fg5c-xmjg

Change-Id: Ia94454c1da778f241085714e1601a0233d547570
2024-08-01 15:27:33 +01:00

22 lines
531 B
JavaScript

const BODY_NOTIFICATIONS_REVEAL_CLASS = 'navigation-enabled secondary-navigation-enabled';
/**
* Wire up the main menu
*
* @ignore
*/
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( ( isOpen ) => {
$( document.body ).toggleClass( BODY_NOTIFICATIONS_REVEAL_CLASS, isOpen );
} );
}
module.exports = {
init
};