Santhosh has uploaded a new change for review.

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

Change subject: Hide the 0 height sections in source column
......................................................................

Hide the 0 height sections in source column

We do not add placeholders for source sections with $element.height()===0.
Sections without any content can still use vertical space because of
margins from style definition. This can cause slight section alignment
errors. We can safely hide them to avoid this issue.

Noticed this while testing the Cupcake article from enwiki for template
features. The first paragraph in source is about protected article status.
It has two templates inside and both will be removed. They also dont take
any vertical height. But the paragraph will take vertical height because of
margins.

Change-Id: Ib0909f49d5a3abac6bf42de7678cb40811a5517d
---
M modules/translation/ext.cx.translation.js
1 file changed, 2 insertions(+), 0 deletions(-)


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

diff --git a/modules/translation/ext.cx.translation.js 
b/modules/translation/ext.cx.translation.js
index 00a7079..fe6a7f3 100644
--- a/modules/translation/ext.cx.translation.js
+++ b/modules/translation/ext.cx.translation.js
@@ -369,6 +369,8 @@
                        // 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 ) {
+                               // Hide the section to avoid the margin, if 
any, take up space.
+                               $sourceSection.hide();
                                continue;
                        }
                        sourceSectionId = $sourceSection.attr( 'id' );

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

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