( function ( mw, $ ) {
mw.searchSuggest = {
// queries the wiki and calls response with the result
- request: function ( api, query, response, maxRows ) {
+ request: function ( api, query, response, maxRows, namespace ) {
return api.get( {
formatversion: 2,
action: 'opensearch',
search: query,
- namespace: 0,
+ namespace: namespace || 0,
limit: maxRows,
suggest: true
} ).done( function ( data, jqXHR ) {
cache: true,
highlightInput: true
} )
- .bind( 'paste cut drop', function () {
+ .on( 'paste cut drop', function () {
// make sure paste and cut events from the mouse and drag&drop events
// trigger the keypress handler and cause the suggestions to update
$( this ).trigger( 'keypress' );