Move getconfig out of api request

This commit is contained in:
alistair3149 2019-12-30 19:45:24 -05:00
parent 4ac41fc37e
commit ec99af3143
No known key found for this signature in database
GPG key ID: 94D081060FD3DD9C

View file

@ -92,7 +92,8 @@ window.WMTypeAhead = function ( appendTo, searchInput ) {
searchString, searchString,
typeAheadItems, typeAheadItems,
activeItem, activeItem,
ssActiveIndex; ssActiveIndex,
extractsChars = mw.config.get( 'wgCitizenSearchExchars' );
// Only create typeAheadEl once on page. // Only create typeAheadEl once on page.
if ( !typeAheadEl ) { if ( !typeAheadEl ) {
@ -268,9 +269,9 @@ window.WMTypeAhead = function ( appendTo, searchInput ) {
format: 'json', format: 'json',
generator: 'prefixsearch', generator: 'prefixsearch',
prop: 'pageprops|pageimages|description|extracts', prop: 'pageprops|pageimages|description|extracts',
exlimit: mw.config.get( 'wgCitizenMaxSearchResults' ), exlimit: maxSearchResults,
exintro: 1, exintro: 1,
exchars: mw.config.get( 'wgCitizenSearchExchars' ), exchars: extractsChars,
explaintext: 1, explaintext: 1,
redirects: '', redirects: '',
ppprop: 'displaytitle', ppprop: 'displaytitle',