* @cfg {jQuery} [$overlay] A jQuery object serving as overlay for popups
*/
mw.rcfilters.ui.FilterWrapperWidget = function MwRcfiltersUiFilterWrapperWidget( controller, model, savedQueriesModel, config ) {
+ var $bottom;
config = config || {};
// Parent
{ $overlay: this.$overlay }
);
- this.savedLinksListWidget = new mw.rcfilters.ui.SavedLinksListWidget(
- this.controller,
- this.queriesModel,
- { $overlay: this.$overlay }
+ this.liveUpdateButton = new mw.rcfilters.ui.LiveUpdateButtonWidget(
+ this.controller
);
// Initialize
this.$element
- .addClass( 'mw-rcfilters-ui-filterWrapperWidget' )
- .append(
- this.savedLinksListWidget.$element,
- this.filterTagWidget.$element
+ .addClass( 'mw-rcfilters-ui-filterWrapperWidget' );
+
+ if ( mw.config.get( 'wgStructuredChangeFiltersEnableSaving' ) ) {
+ this.savedLinksListWidget = new mw.rcfilters.ui.SavedLinksListWidget(
+ this.controller,
+ this.queriesModel,
+ { $overlay: this.$overlay }
+ );
+
+ this.$element.append(
+ this.savedLinksListWidget.$element
);
+
+ }
+
+ $bottom = $( '<div>' )
+ .addClass( 'mw-rcfilters-ui-filterWrapperWidget-bottom' );
+
+ if (
+ mw.config.get( 'wgStructuredChangeFiltersEnableLiveUpdate' ) ||
+ // Allow users to enable live update with ?liveupdate=1
+ new mw.Uri().query.liveupdate
+ ) {
+ $bottom.append( this.liveUpdateButton.$element );
+ }
+
+ this.$element.append(
+ this.filterTagWidget.$element,
+ $bottom
+ );
};
/* Initialization */