Rely on core TOC data to show the TOC in Vector
Bug: T298796 Depends-on: I406acf333d28b3898e3bc4968d05224febd09b3c Change-Id: Iebb9c86b409a49d211c320f540b9af409b604b5b
This commit is contained in:
parent
26835ad0ce
commit
d244f43e39
|
@ -583,6 +583,7 @@ class SkinVector extends SkinMustache {
|
|||
$out = $skin->getOutput();
|
||||
$title = $out->getTitle();
|
||||
$parentData = parent::getTemplateData();
|
||||
$featureManager = VectorServices::getFeatureManager();
|
||||
|
||||
// Naming conventions for Mustache parameters.
|
||||
//
|
||||
|
@ -600,7 +601,6 @@ class SkinVector extends SkinMustache {
|
|||
// It should be followed by the name of the hook in hyphenated lowercase.
|
||||
//
|
||||
// Conditionally used values must use null to indicate absence (not false or '').
|
||||
|
||||
$commonSkinData = array_merge( $parentData, [
|
||||
'is-legacy' => $this->isLegacy(),
|
||||
|
||||
|
@ -611,9 +611,6 @@ class SkinVector extends SkinMustache {
|
|||
'is-language-in-content' => $this->isLanguagesInContent(),
|
||||
'is-language-in-content-top' => $this->isLanguagesInContentAt( 'top' ),
|
||||
'is-language-in-content-bottom' => $this->isLanguagesInContentAt( 'bottom' ),
|
||||
|
||||
'is-vector-table-of-contents-visible' => $this->isTableOfContentsVisibleInSidebar(),
|
||||
|
||||
'data-search-box' => $this->getSearchData(
|
||||
$parentData['data-search-box'],
|
||||
!$this->isLegacy(),
|
||||
|
@ -622,7 +619,7 @@ class SkinVector extends SkinMustache {
|
|||
'searchform',
|
||||
true
|
||||
),
|
||||
'data-vector-sticky-header' => VectorServices::getFeatureManager()->isFeatureEnabled(
|
||||
'data-vector-sticky-header' => $featureManager->isFeatureEnabled(
|
||||
Constants::FEATURE_STICKY_HEADER
|
||||
) ? $this->getStickyHeaderData(
|
||||
$this->getSearchData(
|
||||
|
@ -633,12 +630,16 @@ class SkinVector extends SkinMustache {
|
|||
'vector-sticky-search-form',
|
||||
false
|
||||
),
|
||||
VectorServices::getFeatureManager()->isFeatureEnabled(
|
||||
$featureManager->isFeatureEnabled(
|
||||
Constants::FEATURE_STICKY_HEADER_EDIT
|
||||
)
|
||||
) : false,
|
||||
] );
|
||||
|
||||
if ( !$this->isTableOfContentsVisibleInSidebar() ) {
|
||||
unset( $commonSkinData['data-toc'] );
|
||||
}
|
||||
|
||||
if ( $skin->getUser()->isRegistered() ) {
|
||||
// Note: This data is also passed to legacy template where it is unused.
|
||||
$optOutUrl = [
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
}}
|
||||
<div class="mw-page-container">
|
||||
<a class="mw-jump-link" href="#content">{{msg-vector-jumptocontent}}</a>
|
||||
<div class="mw-page-container-inner {{#is-vector-table-of-contents-visible}} vector-toc-visible{{/is-vector-table-of-contents-visible}}">
|
||||
<div class="mw-page-container-inner {{#data-toc}} vector-toc-visible{{/data-toc}}">
|
||||
|
||||
<input
|
||||
type="checkbox"
|
||||
|
@ -46,9 +46,9 @@
|
|||
|
||||
<div class="mw-workspace-container">
|
||||
{{>Navigation}}
|
||||
{{#is-vector-table-of-contents-visible}}
|
||||
{{#data-toc}}
|
||||
{{>TableOfContents}}
|
||||
{{/is-vector-table-of-contents-visible}}
|
||||
{{/data-toc}}
|
||||
<div class="mw-content-container">
|
||||
{{! `role` is unnecessary but kept to support selectors in any gadgets or user styles. }}
|
||||
<main id="content" class="mw-body" role="main">
|
||||
|
|
Loading…
Reference in New Issue