Santhosh has uploaded a new change for review. https://gerrit.wikimedia.org/r/228220
Change subject: MT Card: Hightlight the section when hovering action buttons ...................................................................... MT Card: Hightlight the section when hovering action buttons This is to indicate that those actions affect that section, potentially overwrites. Bug: T106427 Change-Id: I3d33f579de491628ab713ff2378a930ac38dc72d --- M modules/tools/ext.cx.tools.mt.js 1 file changed, 15 insertions(+), 4 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation refs/changes/20/228220/1 diff --git a/modules/tools/ext.cx.tools.mt.js b/modules/tools/ext.cx.tools.mt.js index b42e4d5..9328215 100644 --- a/modules/tools/ext.cx.tools.mt.js +++ b/modules/tools/ext.cx.tools.mt.js @@ -382,15 +382,25 @@ this.$providerSelectorTrigger.text( this.getProviderTitle( providerId ) ); }; + /* + * Toggle the section highlight. + */ + MTControlCard.prototype.toggleSectionHighlight = function () { + this.$section.toggleClass( 'cx-highlight' ); + }; + MTControlCard.prototype.listen = function () { this.actions.$source - .on( 'click', $.proxy( this.useSource, this ) ); + .on( 'click', $.proxy( this.useSource, this ) ) + .on( 'mouseenter mouseleave', $.proxy( this.toggleSectionHighlight, this ) ); this.actions.$clear - .on( 'click', $.proxy( this.clearTranslation, this ) ); + .on( 'click', $.proxy( this.clearTranslation, this ) ) + .on( 'mouseenter mouseleave', $.proxy( this.toggleSectionHighlight, this ) ); this.actions.$restore - .on( 'click', $.proxy( this.restoreTranslation, this ) ); + .on( 'click', $.proxy( this.restoreTranslation, this ) ) + .on( 'mouseenter mouseleave', $.proxy( this.toggleSectionHighlight, this ) ); }; MTControlCard.prototype.buildProvidersMenu = function () { @@ -464,7 +474,8 @@ .on( 'click', function () { cxMtCard.selectProvider( id ); mw.cx.selection.restore( 'translation' ); - } ); + } ) + .on( 'mouseenter mouseleave', $.proxy( this.toggleSectionHighlight, this ) ); }; MTControlCard.prototype.start = function ( $section ) { -- To view, visit https://gerrit.wikimedia.org/r/228220 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3d33f579de491628ab713ff2378a930ac38dc72d Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ContentTranslation 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