mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-27 17:10:19 +00:00
Rename IconLink to Link
Now that there is a Link.mustache, I think other components like Button, Link should use the Icon template, and not include icon in the name, as its possible to have a link or button that doesnt use an icon as well. Change-Id: I6d8a17dd956f09bb3df7a2503f55d255599874f8
This commit is contained in:
parent
c72cacec71
commit
0e5ef398b2
|
@ -6,9 +6,9 @@ use Linker;
|
|||
use MessageLocalizer;
|
||||
|
||||
/**
|
||||
* VectorComponentIconLink component
|
||||
* VectorComponentLink component
|
||||
*/
|
||||
class VectorComponentIconLink implements VectorComponent {
|
||||
class VectorComponentLink implements VectorComponent {
|
||||
/** @var MessageLocalizer */
|
||||
private $localizer;
|
||||
/** @var string */
|
|
@ -5,7 +5,7 @@ namespace MediaWiki\Skins\Vector\Components;
|
|||
* VectorComponentMenuListItem component
|
||||
*/
|
||||
class VectorComponentMenuListItem implements VectorComponent {
|
||||
/** @var VectorComponentIconLink */
|
||||
/** @var VectorComponentLink */
|
||||
private $link;
|
||||
/** @var string */
|
||||
private $class;
|
||||
|
@ -13,11 +13,11 @@ class VectorComponentMenuListItem implements VectorComponent {
|
|||
private $id;
|
||||
|
||||
/**
|
||||
* @param VectorComponentIconLink $link
|
||||
* @param VectorComponentLink $link
|
||||
* @param string $class
|
||||
* @param string $id
|
||||
*/
|
||||
public function __construct( VectorComponentIconLink $link, string $class = '', string $id = '' ) {
|
||||
public function __construct( VectorComponentLink $link, string $class = '', string $id = '' ) {
|
||||
$this->link = $link;
|
||||
$this->class = $class;
|
||||
$this->id = $id;
|
||||
|
|
|
@ -1 +1 @@
|
|||
<li class="{{item-class}}" {{#item-id}}id="{{.}}"{{/item-id}}>{{>IconLink}}</li>
|
||||
<li class="{{item-class}}" {{#item-id}}id="{{.}}"{{/item-id}}>{{>Link}}</li>
|
||||
|
|
|
@ -12,8 +12,8 @@ const pinnableElementOpenTemplate = fs.readFileSync( 'includes/templates/Pinnabl
|
|||
const pinnableElementCloseTemplate = fs.readFileSync( 'includes/templates/PinnableElement/Close.mustache', 'utf8' );
|
||||
const pinnableHeaderTemplate = fs.readFileSync( 'includes/templates/PinnableHeader.mustache', 'utf8' );
|
||||
const menuTemplate = fs.readFileSync( 'includes/templates/Menu.mustache', 'utf8' );
|
||||
const IconLink = fs.readFileSync( 'includes/templates/IconLink.mustache', 'utf8' );
|
||||
const MenuListItem = fs.readFileSync( 'includes/templates/MenuListItem.mustache', 'utf8' );
|
||||
const linkTemplate = fs.readFileSync( 'includes/templates/Link.mustache', 'utf8' );
|
||||
const menuListItemTemplate = fs.readFileSync( 'includes/templates/MenuListItem.mustache', 'utf8' );
|
||||
|
||||
const templateData = {
|
||||
'is-wide': false,
|
||||
|
@ -69,8 +69,8 @@ const dropdownPartials = {
|
|||
PinnableHeader: pinnableHeaderTemplate,
|
||||
Menu: menuTemplate,
|
||||
MenuContents: menuContents,
|
||||
IconLink,
|
||||
MenuListItem
|
||||
Link: linkTemplate,
|
||||
MenuListItem: menuListItemTemplate
|
||||
};
|
||||
|
||||
const renderedHTML = mustache.render( userLinksTemplate, templateData, dropdownPartials );
|
||||
|
|
Loading…
Reference in a new issue