mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-28 16:10:55 +00:00
Minerva is responsible for loading tablet modules in tablet mode
Since Minerva is the only skin which does this kind of thing, it was premature to add this logic to the Skin module. By forcing Minerva to do this itself, we allow MobileFrontend to be responsible for creating a Skin without having to know about what that skin may want to load in tablet mode. (see I8503c26bd064ae0d203f95a35031468c7c678ac1) Bug: T173454 Change-Id: I32e2b4a10799a06138bfee08abc6769a6b96004d
This commit is contained in:
parent
42e23ff4bc
commit
c04c58a4d7
|
@ -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 );
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
),
|
||||
skinData = {
|
||||
el: 'body',
|
||||
tabletModules: [ 'skins.minerva.tablet.scripts' ],
|
||||
page: getCurrentPage(),
|
||||
referencesGateway: ReferencesMobileViewGateway.getSingleton()
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue