MediaWiki:Common.js: Difference between revisions
Fix TOC placement: ignore Contents heading inside #toc |
Leave default TOC on non-soldier pages; fix changelog Contents box |
||
| Line 229: | Line 229: | ||
} | } | ||
// Contents box belongs | // Contents box belongs after the lead on soldier/profile pages only. | ||
// Other pages (e.g. Site changelog) keep MediaWiki's default TOC placement. | |||
var $toc = $out.find('#toc, .toc, .mw-table-of-contents').first(); | var $toc = $out.find('#toc, .toc, .mw-table-of-contents').first(); | ||
if ($toc.length && !$toc.data('rbTocPlaced')) { | if ($toc.length && !$toc.data('rbTocPlaced')) { | ||
| Line 240: | Line 241: | ||
if ($ibox.length) { | if ($ibox.length) { | ||
$ibox.after($toc); | $ibox.after($toc); | ||
} | } | ||
} | } | ||