Add history icon to page actions menu for AMC mode

Bug: T213352
Change-Id: I6ba11c5969e03bf71fb891558fde68215e978083
This commit is contained in:
Jan Drewniak 2019-02-28 15:21:44 +01:00 committed by Jdlrobson
parent 566178d8ba
commit 69511f16b6
2 changed files with 24 additions and 1 deletions

View File

@ -1158,6 +1158,12 @@ class SkinMinerva extends SkinTemplate {
$menu[] = $this->createWatchPageAction( $actions );
}
if (
MediaWikiServices::getInstance()->getService( 'MobileFrontend.AMC.UserMode' )->isEnabled()
) {
$menu[] = $this->getHistoryPageAction( $actions );
}
if ( $this->isAllowedPageAction( 'edit' ) ) {
$menu[] = $this->createEditPageAction();
}
@ -1265,6 +1271,22 @@ class SkinMinerva extends SkinTemplate {
];
}
/**
* Creates a history action: An icon that links to the mobile history page.
*
* @return array A map of HTML attributes and a 'text' property to be used with the
* pageActionMenu.mustache template.
*/
protected function getHistoryPageAction() {
$baseResult = [
'class' => MinervaUI::iconClass( 'clock-gray' ),
'text' => $this->msg( 'mobile-frontend-history' ),
'href' => $this->getHistoryUrl( $this->getTitle() )
];
return $baseResult;
}
/**
* Checks whether the editor can handle the existing content handler type.
*

View File

@ -65,7 +65,8 @@
}
}
// default layout - spacing out the first menu item
// Layout for less than 5 items - one item at the beginning, rest at the end.
// |1-----2--3--4|
.page-actions-menu__list-item:first-child {
flex-grow: 1;
justify-content: flex-start;