Santhosh has uploaded a new change for review.

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

Change subject: Highlight segment pairs on hover
......................................................................

Highlight segment pairs on hover

Change-Id: I1dc2c2ddc8184ee55ab47b2f3fd63803962a8eb3
---
M modules/source/ext.cx.source.js
M modules/translation/ext.cx.translation.js
2 files changed, 14 insertions(+), 0 deletions(-)


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

diff --git a/modules/source/ext.cx.source.js b/modules/source/ext.cx.source.js
index 6abfe1b..8376d61 100644
--- a/modules/source/ext.cx.source.js
+++ b/modules/source/ext.cx.source.js
@@ -206,6 +206,13 @@
 
                        $( '[data-linkid="' + linkid + '"]' ).removeClass( 
'cx-highlight' );
                } );
+
+               // Highlight segment pairs
+               this.$content.on( 'mouseenter mouseleave', '.cx-segment', 
function () {
+                       var $segment = $( this ),
+                               segmentId = $segment.data( 'segmentid' );
+                       $( '[data-segmentid="' + segmentId + '"]' 
).toggleClass( 'cx-highlight' );
+               } );
        };
 
        $.fn.cxSource = function ( options ) {
diff --git a/modules/translation/ext.cx.translation.js 
b/modules/translation/ext.cx.translation.js
index 107e580..f179d38 100644
--- a/modules/translation/ext.cx.translation.js
+++ b/modules/translation/ext.cx.translation.js
@@ -122,6 +122,13 @@
                        $( '[data-linkid="' + $( this ).data( 'linkid' ) + '"]' 
)
                                .toggleClass( 'cx-highlight' );
                } );
+
+               // Highlight segment pairs
+               this.$container.on( 'mouseenter mouseleave', '.cx-segment', 
function () {
+                       var $segment = $( this ),
+                               segmentId = $segment.data( 'segmentid' );
+                       $( '[data-segmentid="' + segmentId + '"]' 
).toggleClass( 'cx-highlight' );
+               } );
        };
 
        /**

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1dc2c2ddc8184ee55ab47b2f3fd63803962a8eb3
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