mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 00:30:44 +00:00
Update LinkCache in MWTitleInputWidget
Bug: 69886 Change-Id: If7439ea6f60533f8c3166ba4a24656ead0acc6cd
This commit is contained in:
parent
1a94fa8320
commit
056ef20a96
|
@ -103,12 +103,14 @@ ve.ui.MWTitleInputWidget.prototype.getLookupMenuItemsFromData = function ( data
|
|||
var i, len, title, value,
|
||||
menu$ = this.lookupMenu.$,
|
||||
items = [],
|
||||
matchingPages = data;
|
||||
matchingPages = data,
|
||||
linkCacheUpdate = {};
|
||||
|
||||
// Matching pages
|
||||
if ( matchingPages && matchingPages.length ) {
|
||||
for ( i = 0, len = matchingPages.length; i < len; i++ ) {
|
||||
title = new mw.Title( matchingPages[i] );
|
||||
linkCacheUpdate[matchingPages[i]] = { missing: false };
|
||||
if ( this.namespace !== null ) {
|
||||
if ( title.getNamespaceId() === this.namespace ) {
|
||||
value = title.getMainText();
|
||||
|
@ -124,6 +126,7 @@ ve.ui.MWTitleInputWidget.prototype.getLookupMenuItemsFromData = function ( data
|
|||
value, { $: menu$, label: value }
|
||||
) );
|
||||
}
|
||||
ve.init.platform.linkCache.set( linkCacheUpdate );
|
||||
}
|
||||
|
||||
return items;
|
||||
|
|
Loading…
Reference in a new issue