mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 00:30:44 +00:00
Merge "Update LinkCache in MWTitleInputWidget"
This commit is contained in:
commit
d4f1f6ca7a
|
@ -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