Santhosh has uploaded a new change for review. https://gerrit.wikimedia.org/r/177188
Change subject: Do not add placeholder for zero height source sections ...................................................................... Do not add placeholder for zero height source sections Example: .../wiki/Special:ContentTranslation&page=France&from=fr&to=eo&targettitle=France Without this patch see a placeholder added before the first paragraph. It corresponds to a paragraph containing two templates, which we remove That empty paragraph in source section cause an empty placeholder at translation section, causing alignment broken Bug: T76171 Change-Id: I36a2401ca69609d11bf52f75bd7955280584cdcd --- M modules/translation/ext.cx.translation.js 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation refs/changes/88/177188/1 diff --git a/modules/translation/ext.cx.translation.js b/modules/translation/ext.cx.translation.js index 46dcf74..aeae06e 100644 --- a/modules/translation/ext.cx.translation.js +++ b/modules/translation/ext.cx.translation.js @@ -370,6 +370,11 @@ for ( i = 0; i < $sourceSections.length; i++ ) { $sourceSection = $( $sourceSections[ i ] ); + // If source section has zero height, do not add a placeholder + // Zero height means either the section is empty or invisible. + if ( $sourceSection.height() === 0 ) { + continue; + } sourceSectionId = $sourceSection.attr( 'id' ); $placeholder = getPlaceholder( sourceSectionId ) .attr( 'data-cx-section-type', $sourceSection.prop( 'tagName' ) ); -- To view, visit https://gerrit.wikimedia.org/r/177188 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I36a2401ca69609d11bf52f75bd7955280584cdcd 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