mw.widgets.TitleInputWidget: Set default for limit during config init
authorPrateek Saxena <prtksxna@gmail.com>
Fri, 11 Sep 2015 06:06:44 +0000 (11:36 +0530)
committerPrateek Saxena <prtksxna@gmail.com>
Fri, 11 Sep 2015 06:06:44 +0000 (11:36 +0530)
Change-Id: I2a78175b904247a3dceeeeb68c68067367c0dbbd

resources/src/mediawiki.widgets/mw.widgets.TitleInputWidget.js

index 167b318..ee9583d 100644 (file)
                var widget = this;
 
                // Config initialization
-               config = $.extend( { maxLength: 255 }, config );
+               config = $.extend( {
+                       maxLength: 255,
+                       limit: 10
+               }, config );
 
                // Parent constructor
                mw.widgets.TitleInputWidget.parent.call( this, $.extend( {}, config, { autocomplete: false } ) );
@@ -38,7 +41,7 @@
                OO.ui.mixin.LookupElement.call( this, config );
 
                // Properties
-               this.limit = config.limit || 10;
+               this.limit = config.limit;
                this.maxLength = config.maxLength;
                this.namespace = config.namespace !== undefined ? config.namespace : null;
                this.relative = config.relative !== undefined ? config.relative : true;