jenkins-bot has submitted this change and it was merged.

Change subject: Stop lead photo uploader button code loading when disabled.
......................................................................


Stop lead photo uploader button code loading when disabled.

mobile.leadPhotoUploader takes care of this dependency so it does
not need to be in mobile.stable

Change-Id: I971b847bc6873f095384010c89abb61630e11011
---
M includes/Resources.php
M javascripts/modules/mainmenutweaks.js
M javascripts/modules/uploads/init.js
3 files changed, 10 insertions(+), 10 deletions(-)

Approvals:
  Jhernandez: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Resources.php b/includes/Resources.php
index d341f8c..2668b32 100644
--- a/includes/Resources.php
+++ b/includes/Resources.php
@@ -643,11 +643,11 @@
                ),
        ),
 
-       // FIXME: Only load this when uploads are enabled
        'mobile.upload.ui' => $wgMFResourceFileModuleBoilerplate + array(
                'dependencies' => array(
                        'mobile.startup',
                        'mobile.ajax',
+                       'mobile.overlays',
                ),
                'templates' => array(
                        // FIXME: This should not be a hogan template. Use a 
txt template.
@@ -700,7 +700,6 @@
                        'mediawiki.ui.anchor',
                        'mobile.drawers',
                        'mobile.toast',
-                       'mobile.upload.ui',
                        'mobile.redirect',
                ),
        ),
@@ -1109,7 +1108,9 @@
 
        'mobile.special.uploads.scripts' => $wgMFResourceFileModuleBoilerplate 
+ array(
                'dependencies' => array(
-                       'mobile.stable'
+                       'mobile.upload.ui',
+                       'mobile.startup',
+                       'mobile.toast',
                ),
                'templates' => array(
                        'PhotoItem.hogan' => 'templates/specials/photo.hogan',
diff --git a/javascripts/modules/mainmenutweaks.js 
b/javascripts/modules/mainmenutweaks.js
index abb1dff..f3d72d3 100644
--- a/javascripts/modules/mainmenutweaks.js
+++ b/javascripts/modules/mainmenutweaks.js
@@ -2,13 +2,6 @@
  * Disables functionality that is not supported by the app
  */
 ( function ( M, $ ) {
-       var photo = M.require( 'modules/uploads/PhotoUploaderButton' );
-
-       if ( !photo.isSupported ) {
-               // FIXME: We want to enable it to these users however we must 
first deal with what to show
-               // to users who haven't uploaded anything to make the page 
useful.
-               $( '#mw-mf-page-left li.icon-uploads' ).remove();
-       }
        if ( !M.supportsGeoLocation() ) {
                $( '#mw-mf-page-left li.icon-nearby' ).remove();
        }
diff --git a/javascripts/modules/uploads/init.js 
b/javascripts/modules/uploads/init.js
index 35c31ac..28b24a7 100644
--- a/javascripts/modules/uploads/init.js
+++ b/javascripts/modules/uploads/init.js
@@ -43,6 +43,12 @@
 
        if ( isSupported ) {
                $( initialize );
+       } else {
+                       // FIXME: We want to enable it to these users however 
we must first deal with what to show
+                       // to users who haven't uploaded anything to make the 
page useful.
+               $( function () {
+                       $( '#mw-mf-page-left li.icon-uploads' ).remove();
+               } );
        }
 
        M.define( 'modules/uploads/_leadphoto', {

-- 
To view, visit https://gerrit.wikimedia.org/r/173858
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I971b847bc6873f095384010c89abb61630e11011
Gerrit-PatchSet: 7
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: Awjrichards <[email protected]>
Gerrit-Reviewer: Bmansurov <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Jhernandez <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to