* @extends mw.widgets.TitleInputWidget
*
* @constructor
+ * @param {Object} [config] Configuration options
* @cfg {boolean} [pushPending=true] Visually mark the input field as "pending", while
* requesting suggestions.
* @cfg {boolean} [performSearchOnClick=true] If true, the script will start a search when-
icon: 'search',
maxLength: undefined,
performSearchOnClick: true,
- dataLocation: 'header'
+ dataLocation: 'header',
+ namespace: 0
}, config );
// Parent constructor
* @inheritdoc mw.widgets.TitleWidget
*/
mw.widgets.SearchInputWidget.prototype.getSuggestionsPromise = function () {
- var api = new mw.Api(),
+ var api = this.getApi(),
promise,
self = this;
// reuse the searchSuggest function from mw.searchSuggest
- promise = mw.searchSuggest.request( api, this.getQueryValue(), $.noop, this.limit );
+ promise = mw.searchSuggest.request( api, this.getQueryValue(), $.noop, this.limit, this.getNamespace() );
// tracking purposes
promise.done( function ( data, jqXHR ) {