mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-24 07:43:47 +00:00
[vector] Menus: Make Tabs template fully-data driven to support upcoming navigation restructure work
- Template changes to use data driven links - Template changes to use data driven list items - Update unit tests - Stop the hook from clearing data Bug: T329794 Depends-On: Ide47c7ca7acabc21a94991d803f3683240a85f67 Change-Id: I523d7555b603b5382aa59eb25091338c7cc050ec
This commit is contained in:
parent
101176b001
commit
022954aff5
|
@ -1,5 +1,4 @@
|
|||
<a data-mw="interface"
|
||||
href="{{href}}"
|
||||
{{{html-attributes}}}>{{!
|
||||
<a data-mw="interface"{{!
|
||||
}}{{#array-attributes}} {{key}}="{{value}}"{{/array-attributes}}>{{!
|
||||
}}{{#icon}}{{>Icon}}{{/icon}}<span>{{text}}</span>{{!
|
||||
}}</a>
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
}}
|
||||
{{! DO NOT REMOVE vector-menu class. It is used for click tracking in Extension:WikimediaEvents }}
|
||||
<div id="{{id}}" class="vector-menu vector-menu-tabs{{#class}} {{.}}{{/class}}" {{{html-tooltip}}} {{{html-user-language-attributes}}}>
|
||||
{{>MenuContents}}
|
||||
{{>TabsMenuContents}}
|
||||
</div>
|
||||
|
|
6
includes/templates/TabsListItem.mustache
Normal file
6
includes/templates/TabsListItem.mustache
Normal file
|
@ -0,0 +1,6 @@
|
|||
<li id="{{id}}" class="{{class}}">{{!
|
||||
}}{{#array-links}}{{!
|
||||
}}{{>Link}}{{!
|
||||
}}{{/array-links}}{{!
|
||||
}}{{text}}{{!
|
||||
}}</li>
|
7
includes/templates/TabsMenuContents.mustache
Normal file
7
includes/templates/TabsMenuContents.mustache
Normal file
|
@ -0,0 +1,7 @@
|
|||
<div class="vector-menu-content">
|
||||
{{{html-before-portal}}}
|
||||
<ul class="vector-menu-content-list">
|
||||
{{#array-items}}{{>TabsListItem}}{{/array-items}}
|
||||
</ul>
|
||||
{{{html-after-portal}}}
|
||||
</div>
|
|
@ -767,6 +767,6 @@ class VectorHooksTest extends MediaWikiIntegrationTestCase {
|
|||
);
|
||||
$updateItemData->setAccessible( true );
|
||||
$data = $updateItemData->invokeArgs( null, [ $item, $buttonClassProp, $iconHtmlProp ] );
|
||||
$this->assertEquals( $expected, $data );
|
||||
$this->assertArraySubmapSame( $expected, $data );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue