Santhosh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/56909


Change subject: Do not show the first proofread tooltip when proofread disabled.
......................................................................

Do not show the first proofread tooltip when proofread disabled.

Change-Id: I7f036feefc7b34db5916e19abfb54b0072c7d687
---
M resources/js/ext.translate.messagetable.js
M resources/js/ext.translate.proofread.js
2 files changed, 12 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/09/56909/1

diff --git a/resources/js/ext.translate.messagetable.js 
b/resources/js/ext.translate.messagetable.js
index fffa0bc..ed1b6f9 100644
--- a/resources/js/ext.translate.messagetable.js
+++ b/resources/js/ext.translate.messagetable.js
@@ -136,8 +136,10 @@
                                $message = this.addProofread( message );
 
                                if ( !this.firstProofreadTipShown ) {
-                                       $message.find( '.tux-proofread-action' 
).tipsy( 'show' );
-                                       this.firstProofreadTipShown = true;
+                                       if ( $message.find( 
'.tux-proofread-action' ).length ) {
+                                               $message.find( 
'.tux-proofread-action' ).tipsy( 'show' );
+                                               this.firstProofreadTipShown = 
true;
+                                       }
                                }
 
                                return;
diff --git a/resources/js/ext.translate.proofread.js 
b/resources/js/ext.translate.proofread.js
index 7554878..e25ebc3 100644
--- a/resources/js/ext.translate.proofread.js
+++ b/resources/js/ext.translate.proofread.js
@@ -117,16 +117,16 @@
                        this.render();
                        // No review before translating.
                        if ( !this.message.translation ) {
-                               this.hide();
+                               this.disableProofread();
                        }
 
                        // No review for fuzzy messages.
                        if ( this.message.properties.status === 'fuzzy' ) {
-                               this.hide();
+                               this.disableProofread();
                        }
 
                        if ( !mw.translate.canProofread() ) {
-                               this.hide();
+                               this.disableProofread();
                        }
 
                        proofread.$message.translateeditor( {
@@ -137,7 +137,7 @@
                                        proofread.message.translation = 
translation;
                                        proofread.$message.addClass( 
'own-translation' );
                                        // Own translations cannot be reviewed, 
so hide the review button
-                                       proofread.hide();
+                                       proofread.disableProofread();
                                }
                        } );
 
@@ -224,8 +224,8 @@
 
                        if ( translatedBySelf ) {
                                this.$message.addClass( 'own-translation' );
-                               // Own translations cannot be reviewed, so hide 
the review button
-                               this.hide();
+                               // Own translations cannot be reviewed, so 
disable proofread
+                               this.disableProofread();
                        }
 
                        /* Here we need to check that there are reviewers in 
the first place
@@ -235,9 +235,9 @@
                        }
                },
 
-               hide: function () {
+               disableProofread: function () {
                        this.$message.find( '.tux-proofread-action' )
-                               .addClass( 'hide' );
+                               .remove();
                },
 
                /**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7f036feefc7b34db5916e19abfb54b0072c7d687
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to