Merge "entrypoint: Avoid random Doxygen block from api.php and opensearch_desc.php"
[lhc/web/wiklou.git] / resources / src / mediawiki.widgets / mw.widgets.NamespaceInputWidget.js
index ccfc726..15f0d66 100644 (file)
@@ -19,7 +19,7 @@
         */
        mw.widgets.NamespaceInputWidget = function MwWidgetsNamespaceInputWidget( config ) {
                // Configuration initialization
-               config = $.extend( {}, config, { options: this.getNamespaceDropdownOptions( config ) } );
+               config = $.extend( {}, config, { options: this.constructor.static.getNamespaceDropdownOptions( config ) } );
 
                // Parent constructor
                mw.widgets.NamespaceInputWidget.parent.call( this, config );
 
        OO.inheritClass( mw.widgets.NamespaceInputWidget, OO.ui.DropdownInputWidget );
 
-       /* Methods */
+       /* Static methods */
 
        /**
-        * @private
+        * Get a list of namespace options, sorted by ID.
+        *
         * @param {Object} [config] Configuration options
         * @return {Object[]} Dropdown options
         */
-       mw.widgets.NamespaceInputWidget.prototype.getNamespaceDropdownOptions = function ( config ) {
+       mw.widgets.NamespaceInputWidget.static.getNamespaceDropdownOptions = function ( config ) {
                var options,
                        exclude = config.exclude || [],
                        mainNamespace = mw.config.get( 'wgNamespaceIds' )[ '' ];
 
-               // eslint-disable-next-line jquery/no-map-util
+               // eslint-disable-next-line no-jquery/no-map-util
                options = $.map( mw.config.get( 'wgFormattedNamespaces' ), function ( name, ns ) {
                        if ( ns < mainNamespace || exclude.indexOf( Number( ns ) ) !== -1 ) {
                                return null; // skip