mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 18:39:52 +00:00
Merge "ve.dm.MWLanguageVariantNode: Fix "undefined" appearing for some nodes"
This commit is contained in:
commit
69e17ef432
|
@ -216,7 +216,6 @@ ve.dm.MWLanguageVariantNode.static.insertPreviewElements = function ( element, v
|
|||
* @return {string} HTML string
|
||||
*/
|
||||
ve.dm.MWLanguageVariantNode.static.getPreviewHtml = function ( variantInfo, opts ) {
|
||||
var languageIndex, html;
|
||||
if ( variantInfo.disabled ) {
|
||||
return variantInfo.disabled.t;
|
||||
} else if ( variantInfo.name ) {
|
||||
|
@ -224,6 +223,7 @@ ve.dm.MWLanguageVariantNode.static.getPreviewHtml = function ( variantInfo, opts
|
|||
} else if ( variantInfo.filter ) {
|
||||
return variantInfo.filter.t;
|
||||
} else if ( variantInfo.describe || ( opts && opts.describeAll ) ) {
|
||||
var html = '';
|
||||
if ( variantInfo.twoway && variantInfo.twoway.length ) {
|
||||
variantInfo.twoway.forEach( function ( item ) {
|
||||
html += ve.init.platform.getLanguageName( item.l.toLowerCase() ) + ':' +
|
||||
|
@ -238,6 +238,7 @@ ve.dm.MWLanguageVariantNode.static.getPreviewHtml = function ( variantInfo, opts
|
|||
}
|
||||
return html;
|
||||
} else {
|
||||
var languageIndex;
|
||||
if ( variantInfo.twoway && variantInfo.twoway.length ) {
|
||||
languageIndex = this.matchLanguage( variantInfo.twoway );
|
||||
return variantInfo.twoway[ languageIndex ].t;
|
||||
|
|
Loading…
Reference in a new issue