Update LinkCache in MWTitleInputWidget

Bug: 69886
Change-Id: If7439ea6f60533f8c3166ba4a24656ead0acc6cd
This commit is contained in:
Alex Monk 2014-09-09 23:08:14 +01:00
parent 1a94fa8320
commit 056ef20a96

View file

@ -103,12 +103,14 @@ ve.ui.MWTitleInputWidget.prototype.getLookupMenuItemsFromData = function ( data
var i, len, title, value, var i, len, title, value,
menu$ = this.lookupMenu.$, menu$ = this.lookupMenu.$,
items = [], items = [],
matchingPages = data; matchingPages = data,
linkCacheUpdate = {};
// Matching pages // Matching pages
if ( matchingPages && matchingPages.length ) { if ( matchingPages && matchingPages.length ) {
for ( i = 0, len = matchingPages.length; i < len; i++ ) { for ( i = 0, len = matchingPages.length; i < len; i++ ) {
title = new mw.Title( matchingPages[i] ); title = new mw.Title( matchingPages[i] );
linkCacheUpdate[matchingPages[i]] = { missing: false };
if ( this.namespace !== null ) { if ( this.namespace !== null ) {
if ( title.getNamespaceId() === this.namespace ) { if ( title.getNamespaceId() === this.namespace ) {
value = title.getMainText(); value = title.getMainText();
@ -124,6 +126,7 @@ ve.ui.MWTitleInputWidget.prototype.getLookupMenuItemsFromData = function ( data
value, { $: menu$, label: value } value, { $: menu$, label: value }
) ); ) );
} }
ve.init.platform.linkCache.set( linkCacheUpdate );
} }
return items; return items;