Add history icon to page actions menu for AMC mode
Bug: T213352 Change-Id: I6ba11c5969e03bf71fb891558fde68215e978083
This commit is contained in:
parent
566178d8ba
commit
69511f16b6
|
@ -1158,6 +1158,12 @@ class SkinMinerva extends SkinTemplate {
|
||||||
$menu[] = $this->createWatchPageAction( $actions );
|
$menu[] = $this->createWatchPageAction( $actions );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
MediaWikiServices::getInstance()->getService( 'MobileFrontend.AMC.UserMode' )->isEnabled()
|
||||||
|
) {
|
||||||
|
$menu[] = $this->getHistoryPageAction( $actions );
|
||||||
|
}
|
||||||
|
|
||||||
if ( $this->isAllowedPageAction( 'edit' ) ) {
|
if ( $this->isAllowedPageAction( 'edit' ) ) {
|
||||||
$menu[] = $this->createEditPageAction();
|
$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.
|
* Checks whether the editor can handle the existing content handler type.
|
||||||
*
|
*
|
||||||
|
|
|
@ -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 {
|
.page-actions-menu__list-item:first-child {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
|
|
Loading…
Reference in New Issue