[Fix] Adjustment to legacy menu templates

Follow up to c5cfd4d

1) Partial paths are incorrect
These are not a problem with our current Mustache template
parser but could break with any changes in our PHP implementation

2) Add dedicated class to legacy menus

On the longer term this will allow us to further separate the
old and new CSS.

Change-Id: I056b033855c28f919a4af99784620503f10b9dcb
This commit is contained in:
Jon Robson 2022-06-08 11:29:22 -07:00 committed by Jdlrobson
parent bf117d1fc8
commit 49c8b5f514
4 changed files with 12 additions and 6 deletions

View file

@ -779,6 +779,9 @@ abstract class SkinVector extends SkinMustache {
self::MENU_TYPE_PORTAL => 'vector-menu vector-menu-portal portal',
self::MENU_TYPE_DEFAULT => 'vector-menu',
];
if ( $this->isLegacy() ) {
$extraClasses[self::MENU_TYPE_TABS] .= ' vector-menu-tabs-legacy';
}
$portletData['heading-class'] = '';
// Add target class to apply different icon to personal menu dropdown for logged in users.
if ( $portletData['id'] === 'p-personal' ) {

View file

@ -7,7 +7,7 @@
<a class="mw-wiki-logo" href="{{link-mainpage}}"
title="{{msg-tooltip-p-logo}}"></a>
</div>
{{#data-portlets-first}}{{>legacy/Menu}}{{/data-portlets-first}}
{{#array-portlets-rest}}{{>legacy/Menu}}{{/array-portlets-rest}}
{{#data-portlets.data-languages}}{{>legacy/Menu}}{{/data-portlets.data-languages}}
{{#data-portlets-first}}{{>Menu}}{{/data-portlets-first}}
{{#array-portlets-rest}}{{>Menu}}{{/array-portlets-rest}}
{{#data-portlets.data-languages}}{{>Menu}}{{/data-portlets.data-languages}}
</div>

View file

@ -6,7 +6,9 @@
*/
/* Namespaces and Views */
.vector-menu-tabs {
// FIXME: Remove vector-menu-tabs when vector-menu-tabs-legacy is present everywhere
.vector-menu-tabs,
.vector-menu-tabs-legacy {
// Tab separator: Outer start border (left in LTR) of tab row.
background-position: left bottom;
float: left;

View file

@ -255,7 +255,8 @@ class SkinVectorTest extends MediaWikiIntegrationTestCase {
[
// Provided by core
'id' => 'p-views',
'class' => 'mw-portlet mw-portlet-views emptyPortlet vector-menu vector-menu-tabs',
'class' => 'mw-portlet mw-portlet-views emptyPortlet ' .
'vector-menu vector-menu-tabs vector-menu-tabs-legacy',
'html-tooltip' => '',
'html-items' => '',
'html-after-portal' => '',
@ -270,7 +271,7 @@ class SkinVectorTest extends MediaWikiIntegrationTestCase {
$variants = $props['data-variants'];
$actions = $props['data-actions'];
$this->assertSame(
'mw-portlet mw-portlet-namespaces vector-menu vector-menu-tabs',
'mw-portlet mw-portlet-namespaces vector-menu vector-menu-tabs vector-menu-tabs-legacy',
$namespaces['class']
);
$this->assertSame(