mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 14:33:59 +00:00
When normalizing category titles with mw.Title, use getMain method
This will get the name attribute plus this extension Bug: 50702 Change-Id: I57298ef34b413002f1506b499903b73a18969e68
This commit is contained in:
parent
ac6c10dad7
commit
6fba04f121
|
@ -79,7 +79,7 @@ ve.ui.MWCategoryInputWidget.prototype.getLookupCacheItemFromData = function ( da
|
|||
for ( i = 0, len = data[1].length; i < len; i++ ) {
|
||||
try {
|
||||
title = new mw.Title( data[1][i] );
|
||||
result.push( title.getNameText() );
|
||||
result.push( title.getMainText() );
|
||||
} catch ( e ) { }
|
||||
// If the received title isn't valid, just ignore it
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ ve.ui.MWCategoryInputWidget.prototype.getCategoryItemFromValue = function ( valu
|
|||
title = new mw.Title( this.categoryPrefix + value );
|
||||
return {
|
||||
'name': title.getPrefixedText(),
|
||||
'value': title.getNameText(),
|
||||
'value': title.getMainText(),
|
||||
'metaItem': {}
|
||||
};
|
||||
} catch ( e ) { }
|
||||
|
|
Loading…
Reference in a new issue