Remove references to heading in dropdown PHP

Bug: T319358
Change-Id: I9830a4b4b55fdb205c479c09ef807de4f6d68713
This commit is contained in:
bwang 2023-06-22 14:22:07 -05:00
parent 3c741a8505
commit 153c6f2668
5 changed files with 9 additions and 10 deletions

View file

@ -44,9 +44,9 @@ class VectorComponentDropdown implements VectorComponent {
return [
'id' => $this->id,
'label' => $this->label,
'heading-class' => $buttonClass . $iconButtonClass,
'label-class' => $buttonClass . $iconButtonClass,
'icon' => $this->icon,
'html-vector-menu-heading-attributes' => '',
'html-vector-menu-label-attributes' => '',
'html-vector-menu-checkbox-attributes' => '',
'class' => $this->class,
'html-tooltip' => $this->tooltip,

View file

@ -61,18 +61,18 @@ class VectorComponentLanguageDropdown implements VectorComponent {
if ( !$isSubjectPage ) {
$icon = 'language';
$this->class .= ' mw-portlet-lang-icon-only';
$headingClass = $buttonClasses . ' cdx-button--icon-only mw-portlet-lang-heading-empty';
$labelClass = $buttonClasses . ' cdx-button--icon-only mw-portlet-lang-heading-empty';
$checkboxClass = 'mw-interlanguage-selector-empty';
} else {
$icon = 'language-progressive';
$headingClass = $buttonClasses . ' cdx-button--action-progressive'
$labelClass = $buttonClasses . ' cdx-button--action-progressive'
. ' mw-portlet-lang-heading-' . strval( $this->numLanguages );
$checkboxClass = 'mw-interlanguage-selector';
}
$dropdown = new VectorComponentDropdown( 'p-lang-btn', $this->label, $this->class );
$dropdownData = $dropdown->getTemplateData();
// override default heading class.
$dropdownData['heading-class'] = $headingClass;
$dropdownData['label-class'] = $labelClass;
// ext.uls.interface attaches click handler to this selector.
$dropdownData['checkbox-class'] = $checkboxClass;
$dropdownData['icon'] = $icon;

View file

@ -36,7 +36,6 @@ class VectorComponentMenu implements VectorComponent, Countable {
'label' => '',
'html-tooltip' => '',
'label-class' => '',
'heading-class' => '',
'html-before-portal' => '',
'html-items' => '',
'html-after-portal' => '',

View file

@ -25,9 +25,9 @@
<label
id="{{id}}-label"
for="{{id}}-checkbox"
class="vector-menu-heading{{#heading-class}} {{.}}{{/heading-class}}"
class="vector-menu-heading{{#label-class}} {{.}}{{/label-class}}"
aria-hidden="true"
{{{html-vector-menu-heading-attributes}}}
{{{html-vector-menu-label-attributes}}}
>
{{#icon}}{{>Icon}}{{/icon}}
<span class="vector-menu-heading-label">{{label}}</span>

View file

@ -91,8 +91,8 @@ const templateData = {
class: 'mw-portlet mw-portlet-sticky-header-toc vector-sticky-header-toc',
'html-items': '',
'html-vector-menu-checkbox-attributes': 'tabindex="-1"',
'html-vector-menu-heading-attributes': 'tabindex="-1"',
'heading-class': 'cdx-button cdx-button--weight-quiet cdx-button--icon-only'
'html-vector-menu-label-attributes': 'tabindex="-1"',
'label-class': 'cdx-button cdx-button--weight-quiet cdx-button--icon-only'
},
'array-buttons': [ {
label: '0 languages',