Only render table of contents on pages with a table of contents
Bug: T193517 Change-Id: I0ed0255280f525d7726d2e09ceab15a76e2d6026
This commit is contained in:
parent
b56e82c8a8
commit
2e7e7d3259
|
@ -31,7 +31,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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' ) {
|
// provided a table of contents placeholder has been rendered
|
||||||
|
if ( mw.config.get( 'wgAction' ) === 'view' && $( '#toc' ).length > 0 ) {
|
||||||
init( M.getCurrentPage() );
|
init( M.getCurrentPage() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue