mediawiki-skins-Vector/includes/templates/TableOfContents__line.mustache
bwang 8e4da83908 Replace .sidebar-toc class with .vector-toc and use PinnableElement in TOC
Using PinnableElement in the TOC allows us to reuse styles associated with all PinnableElements, and helps ensure consistency between page tools and the TOC. This is something that would probably need to be done for T324505 anyway
Rather than updating PinnableElement to accept a class prop, I chose to rename '.sidebar-toc' to '.vector-toc', making the TOC's naming conventions consistent with the rest of Vector.
"sidebar" doesn't make sense anymore anyway, as the TOC can be in multiple locations and it's best to avoid the "sidebar" term

Bug: T324877
Change-Id: I5b9228380f5c4674ef424d33127a5cb4010822da
2023-01-04 17:48:03 -06:00

21 lines
1.2 KiB
Plaintext

<li id="toc-{{anchor}}"
class="vector-toc-list-item vector-toc-level-{{toclevel}}{{#is-top-level-section}}{{^vector-is-collapse-sections-enabled}} vector-toc-list-item-expanded{{/vector-is-collapse-sections-enabled}}{{/is-top-level-section}} sidebar-toc-list-item sidebar-toc-level-{{toclevel}}{{#is-top-level-section}}{{^vector-is-collapse-sections-enabled}} sidebar-toc-list-item-expanded{{/vector-is-collapse-sections-enabled}}{{/is-top-level-section}}">
<a class="vector-toc-link sidebar-toc-link" href="#{{linkAnchor}}{{^linkAnchor}}{{anchor}}{{/linkAnchor}}">
<div class="vector-toc-text sidebar-toc-text">
<span class="vector-toc-numb sidebar-toc-numb">{{number}}</span>{{{line}}}</div>
</a>
{{#html-summary}}
{{{.}}}
{{/html-summary}}
{{#is-top-level-section}}{{#is-parent-section}}
<button aria-controls="toc-{{anchor}}-sublist" class="mw-ui-icon mw-ui-icon-wikimedia-expand mw-ui-icon-small vector-toc-toggle sidebar-toc-toggle">
{{{vector-button-label}}}
</button>
{{/is-parent-section}}{{/is-top-level-section}}
<ul id="toc-{{anchor}}-sublist" class="vector-toc-list sidebar-toc-list">
{{#array-sections}}
{{>TableOfContents__line}}
{{/array-sections}}
</ul>
</li>