From f2ed7a6a5353846ecc882882db02df22f4e1b834 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Mon, 14 Sep 2015 23:12:59 +0200 Subject: [PATCH] Don't load unused Echo JS/CSS on mobile MobileFrontend has its own implementation of the notifications flyout, so don't load any of Echo's code. We do still need ext.echo.nojs on Special:Notifications though. Bug: T112571 Change-Id: If4d84810070ccd48a8007a3ff80733a7db30fdb3 --- Hooks.php | 2 +- Resources.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Hooks.php b/Hooks.php index 62be237e9..74db95879 100644 --- a/Hooks.php +++ b/Hooks.php @@ -585,7 +585,7 @@ class EchoHooks { * @return bool true in all cases */ static function beforePageDisplay( $out, $skin ) { - if ( $out->getUser()->isLoggedIn() ) { + if ( $out->getUser()->isLoggedIn() && $skin->getSkinName() !== 'minerva' ) { // Load the module for the Notifications flyout $out->addModules( array( 'ext.echo.init' ) ); // Load the styles for the Notifications badge diff --git a/Resources.php b/Resources.php index 633b6428f..6f2999442 100644 --- a/Resources.php +++ b/Resources.php @@ -75,7 +75,7 @@ $wgResourceModules += array( 'tooltip-pt-notifications-message', 'mypreferences' ), - 'targets' => array( 'desktop', 'mobile' ), + 'targets' => array( 'desktop' ), ), 'ext.echo.dm' => $echoResourceTemplate + array( 'scripts' => array( @@ -111,7 +111,7 @@ $wgResourceModules += array( 'dependencies' => array( 'ext.echo.ui' ), - 'targets' => array( 'desktop', 'mobile' ), + 'targets' => array( 'desktop' ), ), // Base no-js styles 'ext.echo.nojs' => $echoResourceTemplate + array(