Jdlrobson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/188561

Change subject: Hygiene: Don't bind mainMenu to mw.mobileFrontend
......................................................................

Hygiene: Don't bind mainMenu to mw.mobileFrontend

We should not be binding anything to mw.mobileFrontend
In future ideally all the functions on mw.mobileFrontend should live in
core / OOJS

Change-Id: I6e4969e220cc32175e3f3d38912154f5e6391363
---
M javascripts/application.js
M javascripts/modules/mainMenu/init.js
2 files changed, 7 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/61/188561/1

diff --git a/javascripts/application.js b/javascripts/application.js
index a025f61..45fedef 100644
--- a/javascripts/application.js
+++ b/javascripts/application.js
@@ -17,12 +17,12 @@
                el: '#mw-mf-viewport',
                tabletModules: mw.config.get( 'skin' ) === 'minerva' ? [ 
'tablet.scripts' ] : [],
                page: getCurrentPage(),
-               mainMenu: M.mainMenu || new MainMenu()
+               mainMenu: new MainMenu()
        } );
        M.define( 'skin', skin );
 
-       $( window ).on( 'resize', $.proxy( M, 'emit', 'resize' ) );
-       $( window ).on( 'scroll', $.proxy( M, 'emit', 'scroll' ) );
+       $( window ).on( 'resize', $.proxy( M, 'emit', 'resize' ) )
+               .on( 'scroll', $.proxy( M, 'emit', 'scroll' ) );
 
        /**
         * Get current page view object
diff --git a/javascripts/modules/mainMenu/init.js 
b/javascripts/modules/mainMenu/init.js
index 8d52964..da04ed3 100644
--- a/javascripts/modules/mainMenu/init.js
+++ b/javascripts/modules/mainMenu/init.js
@@ -1,12 +1,13 @@
 ( function ( M, $ ) {
-       var MainMenu = M.require( 'MainMenu' );
+       var MainMenu = M.require( 'MainMenu' ),
+               mainMenu = new MainMenu();
 
        M.on( 'header-loaded', function () {
                // Render MainMenu when needed
                $( '#mw-mf-main-menu-button' ).on( 'click', function ( ev ) {
                        ev.preventDefault();
-                       M.mainMenu = new MainMenu();
-                       M.mainMenu.openNavigationDrawer( '' );
+                       mainMenu = new MainMenu();
+                       mainMenu.openNavigationDrawer();
                } );
        } );
 }( mw.mobileFrontend, jQuery ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/188561
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6e4969e220cc32175e3f3d38912154f5e6391363
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to