Santhosh has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351291 )

Change subject: CX2: Do not wrap block subtranslation units with <section> tag
......................................................................

CX2: Do not wrap block subtranslation units with <section> tag

Only wrap top level section translation units.

Removed a TODO as well since it is no longer relevant.

Bug: T164067
Change-Id: Id1a44d4bf9fdaa552723a1b3391e1675c2d313e3
---
M modules/ui/translationunits/mw.cx.ui.SectionTranslationUnit.js
1 file changed, 2 insertions(+), 3 deletions(-)


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

diff --git a/modules/ui/translationunits/mw.cx.ui.SectionTranslationUnit.js 
b/modules/ui/translationunits/mw.cx.ui.SectionTranslationUnit.js
index 431fbef..be0a858 100644
--- a/modules/ui/translationunits/mw.cx.ui.SectionTranslationUnit.js
+++ b/modules/ui/translationunits/mw.cx.ui.SectionTranslationUnit.js
@@ -46,7 +46,6 @@
  *  @inheritDoc
  */
 mw.cx.ui.SectionTranslationUnit.prototype.init = function () {
-       // XXX: The model is not yet ready when the constructor is called
        this.$sourceSection = this.createSourceSection( this.model );
        this.$translationSection = this.createTranslationSection( this.model );
 
@@ -59,8 +58,8 @@
  * @return {jQuery}
  */
 mw.cx.ui.SectionTranslationUnit.prototype.createSourceSection = function ( 
model ) {
-       if ( model.sourceDocument.tagName === 'SECTION' ) {
-               // If the sourceDocument is <section> dont wrap it.
+       if ( model.sourceDocument.tagName === 'SECTION' || 
model.getParentTranslationUnit() !== null ) {
+               // If the sourceDocument is <section> or a sub translation 
unit, dont wrap it with <section> tag.
                return $( model.sourceDocument );
        } else {
                // Wrap with <section> tag

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

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