Santhosh has uploaded a new change for review.

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

Change subject: Trigger mw.cx.translation.change event on enter key press
......................................................................

Trigger mw.cx.translation.change event on enter key press

In If390f8abd40b8a11a42, br tags were inserted on enter key press
in sections. But this was not triggering a change event. So If I
press enter and reload the whole translation, I wont see the br in
restored translation. If I do any other change after page break,
the restored translation will have the br tags.

This commit adds mw.cx.translation.change on enter key press so that
the br tag insertion is registered as a translation change.

Follow up: If390f8abd40b8a11a42

Change-Id: I49f454573e3c640dbe112e51f62d0e8a46d41cd0
---
M modules/editor/ext.cx.editor.js
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/modules/editor/ext.cx.editor.js b/modules/editor/ext.cx.editor.js
index a2f75e5..bf1d086 100644
--- a/modules/editor/ext.cx.editor.js
+++ b/modules/editor/ext.cx.editor.js
@@ -97,6 +97,7 @@
                        if ( self.$editableElement.is( 'p, div' ) ) {
                                // insert 2 br tags (if only one br tag is 
inserted the cursor won't go to the second line)
                                mw.cx.selection.pasteHTML( '<br><br>' );
+                               self.onChange();
                                // prevent the default behaviour of return key 
pressed
                                return false;
                        }

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

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

Reply via email to