Add IDs to page-action menu items.

Bug: T215890
Change-Id: I3330f3ccc8226605f44745befc34dcfcc7c474d8
This commit is contained in:
Jan Drewniak 2019-03-25 13:15:09 +01:00 committed by Jdlrobson
parent 784d3fa5ae
commit a809420f8d
2 changed files with 5 additions and 1 deletions

View file

@ -1197,6 +1197,7 @@ class SkinMinerva extends SkinTemplate {
$userCanEdit = $userQuickEditCheck && !$userBlockInfo;
return [
'item-id' => 'page-actions-edit',
'id' => 'ca-edit',
'href' => $title->getLocalURL( $editArgs ),
'class' => 'edit-page '
@ -1225,6 +1226,7 @@ class SkinMinerva extends SkinTemplate {
$icon = 'watch';
}
$baseResult = [
'item-id' => 'page-actions-watch',
'id' => 'ca-watch',
// Use blank icon to reserve space for watchstar icon once JS loads
'class' => MinervaUI::iconClass( $icon, 'element', 'watch-this-article' ) . ' jsonly',
@ -1268,6 +1270,7 @@ class SkinMinerva extends SkinTemplate {
$languageSwitcherClasses .= ' disabled';
}
return [
'item-id' => 'page-actions-languages',
'class' => MinervaUI::iconClass( 'language-switcher', 'element', $languageSwitcherClasses ),
'href' => $languageSwitcherLink,
'title' => $this->msg( 'mobile-frontend-language-article-heading' ),
@ -1283,6 +1286,7 @@ class SkinMinerva extends SkinTemplate {
*/
protected function getHistoryPageAction() {
return [
'item-id' => 'page-actions-history',
'class' => MinervaUI::iconClass( 'clock' ),
'text' => $this->msg( 'mobile-frontend-history' ),
'href' => $this->getHistoryUrl( $this->getTitle() )

View file

@ -1,7 +1,7 @@
<nav class="page-actions-menu">
<ul id="page-actions" class="page-actions-menu__list">
{{#pageactions}}
<li class="page-actions-menu__list-item">
<li id="{{item-id}}" class="page-actions-menu__list-item">
<a id="{{id}}" href="{{href}}" class="{{class}}" role="button" title="{{title}}">
{{text}}
</a>