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

Change subject: Revert "Load correct page actions images"
......................................................................


Revert "Load correct page actions images"

This causes the edit button to remain completely hidden if the user is
blocked or anonymous editing is enabled but an anonymous user doesn't
have permission to edit the page. The edit button must always be shown
(either enabled or disabled).

This reverts commit 65cc96f0dcb32c6911e6a9375bca1a47d346447a.

Change-Id: I359eaa45d82193ac3133daa425d83c3e4b0c1fea
---
M includes/skins/SkinMinerva.php
M javascripts/modules/editor/init.js
M javascripts/modules/uploads/PhotoUploaderButton.js
M javascripts/modules/watchstar/Watchstar.js
4 files changed, 10 insertions(+), 15 deletions(-)

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



diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 88479f9..d7706d9 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -778,7 +778,7 @@
                if ( $this->isAllowedPageAction( 'edit' ) ) {
                        $menu['edit'] = array( 'id' => 'ca-edit', 'text' => '',
                                'itemtitle' => $this->msg( 
'mobile-frontend-pageaction-edit-tooltip' ),
-                               'class' => MobileUI::iconClass( 'edit', 
'element', 'icon-32px hidden' ),
+                               'class' => MobileUI::iconClass( 'edit', 
'element', 'icon-32px' ),
                        );
                }
 
@@ -789,15 +789,14 @@
                ) {
                        $menu['photo'] = array( 'id' => 'ca-upload', 'text' => 
'',
                                'itemtitle' => $this->msg( 
'mobile-frontend-pageaction-upload-tooltip' ),
-                               'class' => MobileUI::iconClass( 'addimage', 
'element', 'icon-32px hidden' ),
+                               'class' => MobileUI::iconClass( 'addimage', 
'element', 'icon-32px' ),
                        );
                }
 
                if ( $this->isAllowedPageAction( 'watch' ) ) {
                        $watchTemplate = array(
                                'id' => 'ca-watch',
-                               'class' => MobileUI::iconClass( 'watch', 
'element',
-                                       'icon-32px watch-this-article hidden' ),
+                               'class' => MobileUI::iconClass( 'watch', 
'element', 'icon-32px watch-this-article' ),
                        );
                        // standardise watch article into one menu item
                        if ( isset( $actions['watch'] ) ) {
diff --git a/javascripts/modules/editor/init.js 
b/javascripts/modules/editor/init.js
index 3847679..6410117 100644
--- a/javascripts/modules/editor/init.js
+++ b/javascripts/modules/editor/init.js
@@ -32,8 +32,7 @@
                                returntoquery: 'article_action=signup-edit'
                        },
                        content: mw.msg( 'mobile-frontend-editor-cta' )
-               } ),
-               $caEdit = $( '#ca-edit' );
+               } );
 
        if ( pendingToast ) {
                // delete the pending toast
@@ -154,10 +153,10 @@
 
                        return result;
                } );
-               $caEdit.addClass( enabledClass ).removeClass( disabledClass 
).removeClass( 'hidden' );
+               $( '#ca-edit' ).addClass( enabledClass ).removeClass( 
disabledClass );
 
                // Make sure we never create two edit links by accident
-               if ( $caEdit.find( '.edit-page' ).length === 0 ) {
+               if ( $( '#ca-edit .edit-page' ).length === 0 ) {
                        // FIXME: unfortunately the main page is special cased.
                        if ( mw.config.get( 'wgIsMainPage' ) || isNewPage || 
page.getLeadSectionElement().text() ) {
                                // if lead section is not empty, open editor 
with lead section
@@ -192,10 +191,9 @@
                // Initialize edit button links (to show Cta) only, if page is 
editable, otherwise show an error toast
                M.getCurrentPage().isEditable( user ).done( function ( 
isEditable ) {
                        if ( isEditable ) {
-                               $caEdit
-                                       .addClass( enabledClass ).removeClass( 
disabledClass ).removeClass( 'hidden' );
+                               $( '#ca-edit' ).addClass( enabledClass 
).removeClass( disabledClass );
                                // Init lead section edit button
-                               makeCta( $caEdit, 0 );
+                               makeCta( $( '#ca-edit' ), 0 );
 
                                // Init all edit links (including lead section, 
if anonymous editing is enabled)
                                $( '.edit-page' ).each( function () {
diff --git a/javascripts/modules/uploads/PhotoUploaderButton.js 
b/javascripts/modules/uploads/PhotoUploaderButton.js
index 97536c6..a4db3be 100644
--- a/javascripts/modules/uploads/PhotoUploaderButton.js
+++ b/javascripts/modules/uploads/PhotoUploaderButton.js
@@ -58,8 +58,6 @@
                        var self = this,
                                $input = this.$( 'input' );
 
-                       self.$el.removeClass( 'hidden' );
-
                        function handleFile( file ) {
                                // FIXME: this is hacky but it would be hard to 
pass a file in a route
                                M.emit( '_upload-preview', file );
diff --git a/javascripts/modules/watchstar/Watchstar.js 
b/javascripts/modules/watchstar/Watchstar.js
index 8125313..7f3fc42 100644
--- a/javascripts/modules/watchstar/Watchstar.js
+++ b/javascripts/modules/watchstar/Watchstar.js
@@ -122,9 +122,9 @@
 
                        // Add watched class if necessary
                        if ( !user.isAnon() && api.isWatchedPage( page ) ) {
-                               $el.addClass( watchedClass ).removeClass( 
unwatchedClass ).removeClass( 'hidden' );
+                               $el.addClass( watchedClass ).removeClass( 
unwatchedClass );
                        } else {
-                               $el.addClass( unwatchedClass ).removeClass( 
watchedClass ).removeClass( 'hidden' );
+                               $el.addClass( unwatchedClass ).removeClass( 
watchedClass );
                        }
                }
        } );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I359eaa45d82193ac3133daa425d83c3e4b0c1fea
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Kaldari <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Kaldari <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to