mw.widgets.TitleInputWidget: Allow limiting to main namespace, too
authorBartosz Dziewoński <matma.rex@gmail.com>
Wed, 22 Jul 2015 00:14:04 +0000 (02:14 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Wed, 22 Jul 2015 00:16:55 +0000 (02:16 +0200)
Not sure if it was intentional or a bug, but the widget would treat
`namespace: 0` (assume main namespace) in config the same as
`namespace: null` (allow all namespaces). This has been changed.

Change-Id: Iab2a76771de0debe9111d4ccce3477b022000e51

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

index bee5920..a9e4384 100644 (file)
@@ -38,7 +38,7 @@
 
                // Properties
                this.limit = config.limit || 10;
-               this.namespace = config.namespace || null;
+               this.namespace = config.namespace !== undefined ? config.namespace : null;
                this.relative = config.relative !== undefined ? config.relative : true;
                this.showRedirectTargets = config.showRedirectTargets !== false;
                this.showRedlink = !!config.showRedlink;