Santhosh has uploaded a new change for review.
https://gerrit.wikimedia.org/r/183016
Change subject: Align the target title after a timeout to get correct dimensions
......................................................................
Align the target title after a timeout to get correct dimensions
Bug: T85219
Change-Id: I898bf9b8a50b55bcab3a97028d7eeee1e5c7198f
---
M modules/translation/ext.cx.translation.js
1 file changed, 5 insertions(+), 6 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation
refs/changes/16/183016/1
diff --git a/modules/translation/ext.cx.translation.js
b/modules/translation/ext.cx.translation.js
index aeaa086..b075078 100644
--- a/modules/translation/ext.cx.translation.js
+++ b/modules/translation/ext.cx.translation.js
@@ -66,12 +66,6 @@
this.$container.append( $heading );
- // The heading of the translation can be significantly shorter
or longer
- // than the heading of the source. Because it uses cxEditor, it
is
- // automatically aligned when it's edited, but not if it's
loaded
- // with explicit targettitle.
- $heading.keepAlignment();
-
if ( mw.cx.targetLanguage ) {
this.$container.prop( {
lang: mw.cx.targetLanguage,
@@ -126,6 +120,11 @@
// dimensions before all css and screenpainting is done,
// there is a chance for section misalignment
window.setTimeout( function () {
+ // The heading of the translation can be
significantly shorter or longer
+ // than the heading of the source. Because it
uses cxEditor, it is
+ // automatically aligned when it's edited, but
not if it's loaded
+ // with explicit targettitle, so it must be
aligned after the source is loaded.
+ cxTranslation.$container.find(
'.cx-column__title' ).keepAlignment();
cxTranslation.addPlaceholders();
mw.hook( 'mw.cx.translation.placeholders.ready'
).fire();
}, 2000 );
--
To view, visit https://gerrit.wikimedia.org/r/183016
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I898bf9b8a50b55bcab3a97028d7eeee1e5c7198f
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