Merge "resourceloader: Simplify StringSet fallback"
[lhc/web/wiklou.git] / resources / src / mediawiki.widgets / mw.widgets.ComplexNamespaceInputWidget.js
index b0c9f91..9bfe87d 100644 (file)
@@ -4,7 +4,7 @@
  * @copyright 2011-2015 MediaWiki Widgets Team and others; see AUTHORS.txt
  * @license The MIT License (MIT); see LICENSE.txt
  */
-( function ( $, mw ) {
+( function () {
 
        /**
         * Namespace input widget. Displays a dropdown box with the choice of available namespaces, plus
         */
        mw.widgets.ComplexNamespaceInputWidget.prototype.setDisabled = function ( disabled ) {
                mw.widgets.ComplexNamespaceInputWidget.parent.prototype.setDisabled.call( this, disabled );
-               this.namespace.setDisabled( disabled );
-
+               if ( this.namespace ) {
+                       this.namespace.setDisabled( disabled );
+               }
                if ( this.invert ) {
                        this.invert.setDisabled( disabled );
                }
                if ( this.associated ) {
                        this.associated.setDisabled( disabled );
                }
+               return this;
        };
 
-}( jQuery, mediaWiki ) );
+}() );