Merge "Added release notes for 'ContentHandler::runLegacyHooks' removal"
[mediawiki.git] / resources / src / mediawiki.rcfilters / ui / mw.rcfilters.ui.FilterGroupWidget.js
blob92ae4d194fc68f25d42e1b8e7cf5b730ac6b2265
1 ( function ( mw, $ ) {
2         /**
3          * A group of filters
4          *
5          * @extends OO.ui.Widget
6          * @mixins OO.ui.mixin.GroupWidget
7          * @mixins OO.ui.mixin.LabelElement
8          *
9          * @constructor
10          * @param {string} name Group name
11          * @param {Object} config Configuration object
12          */
13         mw.rcfilters.ui.FilterGroupWidget = function MwRcfiltersUiFilterGroupWidget( name, config ) {
14                 config = config || {};
16                 // Parent
17                 mw.rcfilters.ui.FilterGroupWidget.parent.call( this, config );
18                 // Mixin constructors
19                 OO.ui.mixin.GroupWidget.call( this, config );
20                 OO.ui.mixin.LabelElement.call( this, $.extend( {}, config, {
21                         $label: $( '<div>' )
22                                 .addClass( 'mw-rcfilters-ui-filterGroupWidget-title' )
23                 } ) );
25                 this.name = name;
27                 this.$element
28                         .addClass( 'mw-rcfilters-ui-filterGroupWidget' )
29                         .append(
30                                 this.$label,
31                                 this.$group
32                                         .addClass( 'mw-rcfilters-ui-filterGroupWidget-group' )
33                         );
34         };
36         /* Initialization */
38         OO.inheritClass( mw.rcfilters.ui.FilterGroupWidget, OO.ui.Widget );
39         OO.mixinClass( mw.rcfilters.ui.FilterGroupWidget, OO.ui.mixin.GroupWidget );
40         OO.mixinClass( mw.rcfilters.ui.FilterGroupWidget, OO.ui.mixin.LabelElement );
42         /**
43          * Get the group name
44          *
45          * @return {string} Group name
46          */
47         mw.rcfilters.ui.FilterGroupWidget.prototype.getName = function () {
48                 return this.name;
49         };
51 }( mediaWiki, jQuery ) );