Merge "Don't add the "minerva--history-page-action-enabled" class to <body> for non-Minerva skins like MonoBook etc."

This commit is contained in:
jenkins-bot 2020-08-03 21:09:17 +00:00 committed by Gerrit Code Review
commit a477102e7e

View file

@ -349,23 +349,22 @@ class MinervaHooks {
public static function onOutputPageBodyAttributes( OutputPage $out, Skin $skin, &$bodyAttrs ) {
$classes = $out->getProperty( 'bodyClassName' );
$skinOptions = MediaWikiServices::getInstance()->getService( 'Minerva.SkinOptions' );
$isMinerva = $skin instanceof SkinMinerva;
if ( $skinOptions->get( SkinOptions::HISTORY_IN_PAGE_ACTIONS ) ) {
if ( $isMinerva && $skinOptions->get( SkinOptions::HISTORY_IN_PAGE_ACTIONS ) ) {
// Class is used when page actions is modified to contain more elements
$classes .= ' minerva--history-page-action-enabled';
}
$isSimplifiedTalk = false;
if ( $skin instanceof SkinMinerva ) {
$isSimplifiedTalk = $skin->isSimplifiedTalkPageEnabled();
}
if ( $isMinerva ) {
// phan doesn't realize that $skin can only be an instance of SkinMinerva without this:
'@phan-var SkinMinerva $skin';
if ( $skin->isSimplifiedTalkPageEnabled() ) {
$classes .= ' skin-minerva--talk-simplified';
}
if ( $isSimplifiedTalk ) {
$classes .= ' skin-minerva--talk-simplified';
$bodyAttrs['class'] .= ' ' . $classes;
}
$bodyAttrs[ 'class' ] .= ' ' . $classes;
}
/**