Merge "statsd: Rename MediawikiStatsdDataFactory to IBufferingStatsdDataFactory"
[lhc/web/wiklou.git] / resources / src / mediawiki.rcfilters / ui / mw.rcfilters.ui.FilterWrapperWidget.js
index 738a981..a748063 100644 (file)
@@ -14,6 +14,7 @@
         * @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' ) ) {
+                       $bottom.append( this.liveUpdateButton.$element );
+               }
+
+               this.$element.append(
+                       this.filterTagWidget.$element,
+                       $bottom
+               );
        };
 
        /* Initialization */