Merge "Shorten long lines in PrefixSearch.php to make phpcs pass"
[lhc/web/wiklou.git] / resources / src / mediawiki / mediawiki.userSuggest.js
index aed093c..3964f0b 100644 (file)
@@ -5,9 +5,8 @@
        var api, config;
 
        config = {
-               fetch: function ( userInput ) {
-                       var $textbox = this,
-                               node = this[0];
+               fetch: function ( userInput, response, maxRows ) {
+                       var node = this[0];
 
                        api = api || new mw.Api();
 
                                list: 'allusers',
                                // Prefix of list=allusers is case sensitive. Normalise first
                                // character to uppercase so that "fo" may yield "Foo".
-                               auprefix: userInput.charAt( 0 ).toUpperCase() + userInput.slice( 1 )
+                               auprefix: userInput.charAt( 0 ).toUpperCase() + userInput.slice( 1 ),
+                               aulimit: maxRows
                        } ).done( function ( data ) {
                                var users = $.map( data.query.allusers, function ( userObj ) {
                                        return userObj.name;
                                } );
-                               // Set the results as the autocomplete options
-                               $textbox.suggestions( 'suggestions', users );
+                               response( users );
                        } ) );
                },
                cancel: function () {