mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-17 19:21:39 +00:00
def03877ce
Bug: T208951 Change-Id: I7cd5ab010596d964fc0896ed250f40d5b6344f6e
33 lines
888 B
JavaScript
33 lines
888 B
JavaScript
( function ( M ) {
|
|
var MainMenu = M.require( 'skins.minerva.mainMenu/MainMenu' ),
|
|
mainMenu = createMainMenu();
|
|
|
|
/**
|
|
* Creates an instance of the `MainMenu`, using the `wgMinervaMenuData` for configuration.
|
|
*
|
|
* N.B. that the activator - the UI element that the user must click in order to open the main
|
|
* menu - is always `.header .main-menu-button`.
|
|
*
|
|
* @return {MainMenu}
|
|
*
|
|
* @ignore
|
|
*/
|
|
function createMainMenu() {
|
|
var options = mw.config.get( 'wgMinervaMenuData' );
|
|
|
|
options.activator = '.header .main-menu-button';
|
|
|
|
return new MainMenu( options );
|
|
}
|
|
|
|
$( function () {
|
|
if ( !$( '#mw-mf-page-left' ).find( '.menu' ).length ) {
|
|
// Now we have a main menu button register it.
|
|
mainMenu.registerClickEvents();
|
|
mainMenu.appendTo( '#mw-mf-page-left' );
|
|
}
|
|
} );
|
|
|
|
M.define( 'skins.minerva.scripts.top/mainMenu', mainMenu );
|
|
}( mw.mobileFrontend ) );
|