jenkins-bot has submitted this change and it was merged.
Change subject: Define the 'skin' module outside DOM ready.
......................................................................
Define the 'skin' module outside DOM ready.
'mobile.startup' module is loaded after '#mw-mf-viewport'
has been added to the page so there is no need to wait until DOM is ready.
Change-Id: I48319bc9d2e0d3ebeb16d7449ac33bf4c2fa8ed9
---
M javascripts/application.js
1 file changed, 9 insertions(+), 17 deletions(-)
Approvals:
Jdlrobson: Looks good to me, approved
jenkins-bot: Verified
diff --git a/javascripts/application.js b/javascripts/application.js
index 7b95341..a025f61 100644
--- a/javascripts/application.js
+++ b/javascripts/application.js
@@ -13,22 +13,16 @@
MainMenu = M.require( 'MainMenu' ),
Skin = M.require( 'Skin' );
- /**
- * Initialize viewport
- * @method
- */
- function init() {
- skin = new Skin( {
- el: '#mw-mf-viewport',
- tabletModules: mw.config.get( 'skin' ) === 'minerva' ?
[ 'tablet.scripts' ] : [],
- page: getCurrentPage(),
- mainMenu: M.mainMenu || new MainMenu()
- } );
- M.define( 'skin', skin );
+ skin = new Skin( {
+ el: '#mw-mf-viewport',
+ tabletModules: mw.config.get( 'skin' ) === 'minerva' ? [
'tablet.scripts' ] : [],
+ page: getCurrentPage(),
+ mainMenu: M.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' ) );
+ $( window ).on( 'scroll', $.proxy( M, 'emit', 'scroll' ) );
/**
* Get current page view object
@@ -77,8 +71,6 @@
M.define( 'pageApi', pageApi );
- // Initialize
- $( init );
// Recruit volunteers through the console (note console.log may not be
a function so check via apply)
if ( window.console && window.console.log && window.console.log.apply &&
mw.config.get( 'wgMFEnableJSConsoleRecruitment' ) ) {
--
To view, visit https://gerrit.wikimedia.org/r/188483
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I48319bc9d2e0d3ebeb16d7449ac33bf4c2fa8ed9
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Bmansurov <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits