Amire80 has uploaded a new change for review.
https://gerrit.wikimedia.org/r/213818
Change subject: Fix source page selector widget functionality
......................................................................
Fix source page selector widget functionality
Move its initialization after setting the default source language,
otherwise it's uninitialized.
Bug: T100420
Change-Id: I2cfd965b3ae7d63c7725f9c279b989ccb23274b9
---
M modules/source/ext.cx.source.selector.js
1 file changed, 6 insertions(+), 3 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation
refs/changes/18/213818/1
diff --git a/modules/source/ext.cx.source.selector.js
b/modules/source/ext.cx.source.selector.js
index 3cffd21..ff01210 100644
--- a/modules/source/ext.cx.source.selector.js
+++ b/modules/source/ext.cx.source.selector.js
@@ -170,6 +170,7 @@
*/
CXSourceSelector.prototype.setSourceLanguage = function ( language ) {
var langProps;
+
// Don't let the same languages be selected as source and
target.
// Instead, do what the user probably means and swap them.
if ( language === this.getTargetLanguage() ) {
@@ -849,9 +850,7 @@
$sourceTitleInputContainer = $( '<div>' )
.addClass( 'cx-sourceselector-dialog__title' )
.append( this.$sourceTitleInput );
- this.$sourcePageSelector = new mw.PageSelector(
this.$sourceTitleInput, {
- api: this.siteMapper.getApi( this.getSourceLanguage() )
- } );
+
this.$targetTitleInput = $( '<input>' )
.attr( {
name: 'targetTitle',
@@ -880,6 +879,10 @@
this.setDefaultLanguages();
+ this.$sourcePageSelector = new mw.PageSelector(
this.$sourceTitleInput, {
+ api: this.siteMapper.getApi( this.getSourceLanguage() )
+ } );
+
this.$messageBar = $( '<div>' )
.addClass( 'cx-sourceselector-dialog__messagebar' );
$messageText = $( '<span>' )
--
To view, visit https://gerrit.wikimedia.org/r/213818
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2cfd965b3ae7d63c7725f9c279b989ccb23274b9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Amire80 <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits