diff --git a/resources/skins.minerva.tablet.scripts/toc.js b/resources/skins.minerva.tablet.scripts/toc.js index b7811d0..80f851a 100644 --- a/resources/skins.minerva.tablet.scripts/toc.js +++ b/resources/skins.minerva.tablet.scripts/toc.js @@ -31,7 +31,8 @@ } // 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() ); }