mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-28 17:40:12 +00:00
7d32ec80d3
Collapses sub-sections in the new table of contents by default (except for non-js and reduced-motion users) and expands the sections when the top-level section link has been clicked. Refactors the `activateSection` TableOfContents methods into separate `activateSection` and `deactivateSection` functions. Adds `expandSection` and `collapseSection` methods. Adds triangle icon as a visual expand/collapsed indicator next to all ToC section headings and are hidden via CSS based on whether or not the section contains subsections. Adds test for tableOfContents. Bug: T299361 Change-Id: I36b3ae7f9f633877683bc17a9444c970d7fa7293
12 lines
358 B
Plaintext
12 lines
358 B
Plaintext
<li id="toc-{{anchor}}" class="sidebar-toc-list-item sidebar-toc-level-{{toclevel}}">
|
|
<a class="sidebar-toc-link" href="#{{anchor}}">
|
|
<div class="sidebar-toc-text">
|
|
<span class="sidebar-toc-numb">{{number}}</span>{{{line}}}</div>
|
|
</a>
|
|
<ul class="sidebar-toc-list">
|
|
{{#array-sections}}
|
|
{{>TableOfContents__line}}
|
|
{{/array-sections}}
|
|
</ul>
|
|
</li>
|