Santhosh has uploaded a new change for review.

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

Change subject: After translation is filled up, unblind click handler to source 
section
......................................................................

After translation is filled up, unblind click handler to source section

This dangling click handler was triggering duplicate word select events
and causing duplicate api request.

Change-Id: I37bc796ca85d788751e60d5902ddf29fdc1d8aeb
---
M modules/translation/ext.cx.translation.js
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/02/149802/1

diff --git a/modules/translation/ext.cx.translation.js 
b/modules/translation/ext.cx.translation.js
index fc7bd44..f1ddf9a 100644
--- a/modules/translation/ext.cx.translation.js
+++ b/modules/translation/ext.cx.translation.js
@@ -142,13 +142,15 @@
        ContentTranslationEditor.prototype.postProcessMT = function ( $section 
) {
                var $sourceSection;
 
+               $sourceSection = $( '#' + $section.data( 'source' ) );
+               // Translation filled up. Unblind click handler for the source 
section.
+               $sourceSection.unbind( 'click', sourceSectionClickHandler );
+
                // Adapt links
                $section.adaptLinks( mw.cx.targetLanguage );
                // Adapt images
                $section.find( 'img' ).adaptImage( mw.cx.targetLanguage );
                // Adapt references
-               $sourceSection = $( '#' + $section.data( 'source' ) );
-
                if ( $.fn.adaptReferences ) { // This is an experimental feature
                        $section.find( '[typeof="mw:Extension/ref"]' 
).adaptReferences();
                }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I37bc796ca85d788751e60d5902ddf29fdc1d8aeb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <[email protected]>

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

Reply via email to