Merge "Minerva is responsible for loading tablet modules in tablet mode"

This commit is contained in:
jenkins-bot 2017-10-11 22:57:43 +00:00 committed by Gerrit Code Review
commit 1c0d0d5f3c
2 changed files with 15 additions and 1 deletions

View file

@ -2,6 +2,7 @@
var inSample, inStable, experiment,
toast = M.require( 'mobile.startup/toast' ),
time = M.require( 'mobile.startup/time' ),
browser = M.require( 'mobile.startup/Browser' ).getSingleton(),
token = mw.storage.get( 'mobile-betaoptin-token' ),
BetaOptinPanel = M.require( 'mobile.betaoptin/BetaOptinPanel' ),
loader = M.require( 'mobile.startup/rlModuleLoader' ),
@ -73,6 +74,18 @@
return lang ? lang.toLowerCase() : undefined;
}
/**
* Loads tablet modules when the skin is in tablet mode and the
* current page is in the main namespace.
* @method
* @ignore
*/
function loadTabletModules() {
if ( browser.isWideScreen() && page.inNamespace( '' ) ) {
mw.loader.using( 'skins.minerva.tablet.scripts' );
}
}
/**
* Load image overlay
* @method
@ -243,6 +256,8 @@
initModifiedInfo();
initRegistrationInfo();
initHistoryLink( $( '.last-modifier-tagline a' ) );
M.on( 'resize', loadTabletModules );
loadTabletModules();
} );
M.define( 'skins.minerva.scripts/overlayManager', overlayManager );

View file

@ -18,7 +18,6 @@
),
skinData = {
el: 'body',
tabletModules: [ 'skins.minerva.tablet.scripts' ],
page: getCurrentPage(),
referencesGateway: ReferencesMobileViewGateway.getSingleton()
};