Merge "Fix: always show table of contents"

This commit is contained in:
jenkins-bot 2018-03-28 19:10:20 +00:00 committed by Gerrit Code Review
commit 94d0229b74
2 changed files with 13 additions and 18 deletions

View File

@ -1285,8 +1285,6 @@ class SkinMinerva extends SkinTemplate implements ICustomizableSkin {
$vars = [ $vars = [
'wgMinervaDownloadNamespaces' => $this->getConfig()->get( 'MinervaDownloadNamespaces' ), 'wgMinervaDownloadNamespaces' => $this->getConfig()->get( 'MinervaDownloadNamespaces' ),
'wgMinervaMenuData' => $this->getMenuData(), 'wgMinervaMenuData' => $this->getMenuData(),
// Expose for skins.minerva.tablet.scripts
'wgMinervaTocEnabled' => $out->getProperty( 'MFTOC' ),
'wgMFDescription' => $out->getProperty( 'wgMFDescription' ), 'wgMFDescription' => $out->getProperty( 'wgMFDescription' ),
]; ];

View File

@ -12,10 +12,8 @@
function init( page ) { function init( page ) {
var toc, var toc,
sections = page.getSections(), sections = page.getSections(),
$toc = $( '#toc' ), $toc = $( '#toc' );
enableToc = mw.config.get( 'wgMinervaTocEnabled' );
if ( enableToc ) {
toc = new TableOfContents( { toc = new TableOfContents( {
sections: sections sections: sections
} ); } );
@ -31,7 +29,6 @@
toc.appendTo( page.getLeadSectionElement() ); toc.appendTo( page.getLeadSectionElement() );
} }
} }
}
// add a ToC only for "view" action (user is reading a page) // add a ToC only for "view" action (user is reading a page)
if ( mw.config.get( 'wgAction' ) === 'view' ) { if ( mw.config.get( 'wgAction' ) === 'view' ) {