Change-Id: I530bca7950fa75e667d7e5f08d51b304fe3ad14b
*
* @constructor
* @param {Object} [config] Configuration options
+ * @cfg {number} [limit=10] Maximum number of results to load
*/
mw.widgets.CategorySelector = function ( config ) {
+ // Config initialization
+ config = $.extend( { limit: 10 }, config );
+ this.limit = config.limit;
+
// Parent constructor
mw.widgets.CategorySelector.parent.call( this, config );
api.get( {
action: 'opensearch',
namespace: catNsId,
- limit: 10,
+ limit: this.limit,
search: input
} ).done( function ( res ) {
var categoryNames = res[ 1 ].map( function ( name ) {