3 * List displaying all filter groups
5 * @extends OO.ui.Widget
6 * @mixins OO.ui.mixin.PendingElement
9 * @param {mw.rcfilters.Controller} controller Controller
10 * @param {mw.rcfilters.dm.FiltersViewModel} model View model
11 * @param {mw.rcfilters.dm.SavedQueriesModel} savedQueriesModel Saved queries model
12 * @param {mw.rcfilters.dm.ChangesListViewModel} changesListModel
13 * @param {Object} [config] Configuration object
14 * @cfg {Object} [filters] A definition of the filter groups in this list
15 * @cfg {jQuery} [$overlay] A jQuery object serving as overlay for popups
17 mw
.rcfilters
.ui
.FilterWrapperWidget
= function MwRcfiltersUiFilterWrapperWidget(
18 controller
, model
, savedQueriesModel
, changesListModel
, config
21 config
= config
|| {};
24 mw
.rcfilters
.ui
.FilterWrapperWidget
.parent
.call( this, config
);
26 OO
.ui
.mixin
.PendingElement
.call( this, config
);
28 this.controller
= controller
;
30 this.queriesModel
= savedQueriesModel
;
31 this.$overlay
= config
.$overlay
|| this.$element
;
33 this.filterTagWidget
= new mw
.rcfilters
.ui
.FilterTagMultiselectWidget(
37 { $overlay
: this.$overlay
}
40 this.liveUpdateButton
= new mw
.rcfilters
.ui
.LiveUpdateButtonWidget(
45 this.numChangesWidget
= new mw
.rcfilters
.ui
.ChangesLimitButtonWidget(
49 $overlay
: this.$overlay
53 this.dateWidget
= new mw
.rcfilters
.ui
.DateButtonWidget(
57 $overlay
: this.$overlay
62 this.$top
= $( '<div>' )
63 .addClass( 'mw-rcfilters-ui-filterWrapperWidget-top' );
65 $bottom
= $( '<div>' )
66 .addClass( 'mw-rcfilters-ui-filterWrapperWidget-bottom' )
68 this.numChangesWidget
.$element
,
69 this.dateWidget
.$element
72 if ( mw
.rcfilters
.featureFlags
.liveUpdate
) {
73 $bottom
.append( this.liveUpdateButton
.$element
);
77 .addClass( 'mw-rcfilters-ui-filterWrapperWidget' )
80 this.filterTagWidget
.$element
,
87 OO
.inheritClass( mw
.rcfilters
.ui
.FilterWrapperWidget
, OO
.ui
.Widget
);
88 OO
.mixinClass( mw
.rcfilters
.ui
.FilterWrapperWidget
, OO
.ui
.mixin
.PendingElement
);
93 * Set the content of the top section
95 * @param {jQuery} $topSectionElement
97 mw
.rcfilters
.ui
.FilterWrapperWidget
.prototype.setTopSection = function ( $topSectionElement
) {
98 this.$top
.append( $topSectionElement
);