jenkins-bot has submitted this change and it was merged.
Change subject: Suggestions displayed on clicking the highlighted error
......................................................................
Suggestions displayed on clicking the highlighted error
Change-Id: Ic6d5695f6f7cf05846e7c9478bf1651429b3eb65
---
M modules/ext.LanguageToolDialog.js
1 file changed, 16 insertions(+), 0 deletions(-)
Approvals:
Amire80: Looks good to me, approved
Eranroz: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/modules/ext.LanguageToolDialog.js
b/modules/ext.LanguageToolDialog.js
index d407816..d322bac 100644
--- a/modules/ext.LanguageToolDialog.js
+++ b/modules/ext.LanguageToolDialog.js
@@ -171,6 +171,7 @@
this.surface.getModel().connect( this, {
documentUpdate: this.updateFragmentsDebounced } );
this.surface.getView().connect( this, { position:
this.renderFragmentsDebounced } );
this.surface.getView().$window.on( 'scroll',
this.onWindowScrollDebounced );
+ this.surface.getModel().on( 'select',
this.onSelect.bind( this ) );
text = fragment.getText();
if ( text && text !== this.findText.getValue() ) {
@@ -181,6 +182,21 @@
}, this );
};
+mw.LanguageToolDialog.prototype.onSelect = function ( e ) {
+ var i, r, range;
+
+ if ( !e.isNull() ) {
+ range = e.getRange();
+ for ( i = 0; i < this.fragments.length; i++ ) {
+ r = this.fragments[ i ].getSelection().getRange();
+ if ( r.start <= range.start && r.end >= range.end ) {
+ this.focusedIndex = i;
+ this.highlightFocused();
+ }
+ }
+ }
+};
+
/**
* @inheritdoc
*/
--
To view, visit https://gerrit.wikimedia.org/r/232572
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic6d5695f6f7cf05846e7c9478bf1651429b3eb65
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/LanguageTool
Gerrit-Branch: master
Gerrit-Owner: Ankita-ks <[email protected]>
Gerrit-Reviewer: Amire80 <[email protected]>
Gerrit-Reviewer: Eranroz <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits