Merge "SpecialNewpages: add $attribs['class'] immediately before creating <li>"
[lhc/web/wiklou.git] / resources / src / mediawiki.rcfilters / ui / mw.rcfilters.ui.FormWrapperWidget.js
index 44f6da7..5a64edd 100644 (file)
@@ -54,7 +54,7 @@
         * @return {boolean} false
         */
        mw.rcfilters.ui.FormWrapperWidget.prototype.onLinkClick = function ( e ) {
-               this.controller.updateChangesList( true, $( e.target ).data( 'params' ) );
+               this.controller.updateChangesList( $( e.target ).data( 'params' ) );
                return false;
        };
 
@@ -78,7 +78,7 @@
                        data[ $( this ).prop( 'name' ) ] = value;
                } );
 
-               this.controller.updateChangesList( true, data );
+               this.controller.updateChangesList( data );
                return false;
        };
 
         * Clean up the old-style show/hide that we have implemented in the filter list
         */
        mw.rcfilters.ui.FormWrapperWidget.prototype.cleanUpFieldset = function () {
-               var $namespaceSelect = this.$element.find( '#namespace' );
-
-               this.$element.find( '.rcshowhideoption[data-feature-in-structured-ui=1]' ).each( function () {
+               this.$element.find( '.clshowhideoption[data-feature-in-structured-ui=1]' ).each( function () {
                        // HACK: Remove the text node after the span.
                        // If there isn't one, we're at the end, so remove the text node before the span.
                        // This would be unnecessary if we added separators with CSS.
                } );
 
                // Hide namespaces and tags
-               $namespaceSelect.closest( 'tr' ).detach();
+               this.$element.find( '.namespaceForm' ).detach();
                this.$element.find( '.mw-tagfilter-label' ).closest( 'tr' ).detach();
 
-               // Hide limit and days
-               this.$element.find( '.rclinks' ).detach();
+               // misc: limit, days, watchlist info msg
+               this.$element.find( '.rclinks, .cldays, .wlinfo' ).detach();
 
                if ( !this.$element.find( '.mw-recentchanges-table tr' ).length ) {
                        this.$element.find( '.mw-recentchanges-table' ).detach();
                        this.$element.find( 'br' ).detach();
                }
 
-               this.$element.find(
-                       'legend, .rclistfrom, .rcnotefrom, .rcoptions-listfromreset'
-               ).detach();
+               if ( this.$element.find( '.cloption' ).text().trim() === '' ) {
+                       this.$element.find( '.cloption-submit' ).detach();
+               }
+
+               if ( mw.rcfilters.featureFlags.liveUpdate ) {
+                       this.$element.find(
+                               '.rclistfrom, .rcnotefrom, .rcoptions-listfromreset'
+                       ).detach();
+               }
 
-               if ( this.$element.text().trim() === '' ) {
+               if ( this.$element.text().trim() === this.$element.find( 'legend' ).text() ) {
                        this.$element.detach();
                }
        };