Specify the responsive option rather than manually specifying viewport

I6e69b482cdbc adds a viewport with the same value as MonoBook.

Bug: T258290
Depends-On: I6e69b482cdbc49c09adc6f7cee54f5e17b7c92c4
Change-Id: Iae529da5dba07a2eee91a1fa7b29e4bdc163aa40
This commit is contained in:
mainframe98 2020-08-03 21:11:19 +02:00
parent a891fd477c
commit bce6d15d35

View file

@ -35,16 +35,21 @@ class SkinMonoBook extends SkinTemplate {
public $template = 'MonoBookTemplate';
/**
* @inheritDoc
* @return bool
*/
public function isResponsive() {
return $this->getUser()->getOption( 'monobook-responsive' );
}
/**
* @inheritDoc
* @param OutputPage $out
*/
public function setupSkinUserCss( OutputPage $out ) {
parent::setupSkinUserCss( $out );
public function initPage( OutputPage $out ) {
parent::initPage( $out );
if ( $out->getUser()->getOption( 'monobook-responsive' ) ) {
$out->addMeta( 'viewport',
'width=device-width, initial-scale=1.0, ' .
'user-scalable=yes, minimum-scale=0.25, maximum-scale=5.0'
);
if ( $this->isResponsive() ) {
$styleModule = 'skins.monobook.responsive';
$out->addModules( [
'skins.monobook.mobile'