mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-28 08:00:32 +00:00
Merge "Fix history link"
This commit is contained in:
commit
f4b3b11053
|
@ -439,29 +439,36 @@ class SkinMinerva extends SkinMustache {
|
|||
->getRevisionLookup()
|
||||
->getTimestampFromId( $out->getRevisionId() );
|
||||
}
|
||||
$historyIconClasses = [
|
||||
'historyIconClass' => MinervaUI::iconClass(
|
||||
'history-base20', 'mw-ui-icon-small', '', 'wikimedia'
|
||||
),
|
||||
'arrowIconClass' => MinervaUI::iconClass(
|
||||
'expand-gray', 'small',
|
||||
'mf-mw-ui-icon-rotate-anti-clockwise indicator',
|
||||
// Uses icon in MobileFrontend so must be prefixed mf.
|
||||
// Without MobileFrontend it will not render.
|
||||
// Rather than maintain 2 versions (and variants) of the arrow icon which can conflict
|
||||
// with each othe and bloat CSS, we'll
|
||||
// use the MobileFrontend one. Long term when T177432 and T160690 are resolved
|
||||
// we should be able to use one icon definition and break this dependency.
|
||||
'mf'
|
||||
),
|
||||
];
|
||||
$historyLink = !$isLatestRevision || $title->isMainPage() ?
|
||||
$this->getGenericHistoryLink( $title ) :
|
||||
$this->getRelativeHistoryLink( $title, $timestamp );
|
||||
|
||||
// Create history link and corresponding icons.
|
||||
$historyLinkAndIcons = [];
|
||||
if ( Action::getActionName( RequestContext::getMain() ) === 'view' ) {
|
||||
$historyIconClasses = [
|
||||
'historyIconClass' => MinervaUI::iconClass(
|
||||
'history-base20', 'mw-ui-icon-small', '', 'wikimedia'
|
||||
),
|
||||
'arrowIconClass' => MinervaUI::iconClass(
|
||||
'expand-gray', 'small',
|
||||
'mf-mw-ui-icon-rotate-anti-clockwise indicator',
|
||||
// Uses icon in MobileFrontend so must be prefixed mf.
|
||||
// Without MobileFrontend it will not render.
|
||||
// Rather than maintain 2 versions (and variants) of the arrow icon which can conflict
|
||||
// with each othe and bloat CSS, we'll
|
||||
// use the MobileFrontend one. Long term when T177432 and T160690 are resolved
|
||||
// we should be able to use one icon definition and break this dependency.
|
||||
'mf'
|
||||
),
|
||||
];
|
||||
$historyLink = !$isLatestRevision || $title->isMainPage() ?
|
||||
$this->getGenericHistoryLink( $title ) :
|
||||
$this->getRelativeHistoryLink( $title, $timestamp );
|
||||
|
||||
$historyLinkAndIcons = $historyLink + $historyIconClasses;
|
||||
}
|
||||
|
||||
$title = $this->getTitle();
|
||||
return $title->canExist() && $title->exists()
|
||||
? $historyLink + $historyIconClasses
|
||||
return $title->canExist() && $title->exists() && !empty( $historyLinkAndIcons )
|
||||
? $historyLinkAndIcons
|
||||
: null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue