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

Change subject: Check that there are editing controls when removing tipsy
......................................................................


Check that there are editing controls when removing tipsy

Fixes the following scenario:
* Open proofreading.
* Edit a message and save it. Wait for it to be marked as
  self-translated.
* Try editing it again. Currently this causes a JavaScript error,
  because tipsy cannot be removed from a non-existent element.

Change-Id: Icbddb735ea505d3c65811c06cf54df7e0cde85e8
---
M resources/js/ext.translate.proofread.js
1 file changed, 4 insertions(+), 1 deletion(-)

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



diff --git a/resources/js/ext.translate.proofread.js 
b/resources/js/ext.translate.proofread.js
index 1bed993..e9c81b9 100644
--- a/resources/js/ext.translate.proofread.js
+++ b/resources/js/ext.translate.proofread.js
@@ -306,7 +306,10 @@
 
                        this.$message.find( '.tux-proofread-edit' ).on( 
'click', function () {
                                // Make sure that the tipsy is hidden when 
going to the editor
-                               $( this ).siblings( '.tux-proofread-action' 
).tipsy( 'hide' );
+                               var $tuxProofreadAction = $( this ).siblings( 
'.tux-proofread-action' );
+                               if ( $tuxProofreadAction.length ) {
+                                       $tuxProofreadAction.tipsy( 'hide' );
+                               }
 
                                proofread.$message.data( 'translateeditor' 
).show();
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Icbddb735ea505d3c65811c06cf54df7e0cde85e8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Amire80 <amir.ahar...@mail.huji.ac.il>
Gerrit-Reviewer: Amire80 <amir.ahar...@mail.huji.ac.il>
Gerrit-Reviewer: Nikerabbit <niklas.laxst...@gmail.com>
Gerrit-Reviewer: Siebrand <siebr...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to