Merge "Fix \n handling for HTMLUsersMultiselectField"
[lhc/web/wiklou.git] / resources / src / mediawiki.rcfilters / ui / mw.rcfilters.ui.FormWrapperWidget.js
index ec10d44..dbee65c 100644 (file)
 
                // Collect all data from form
                $( e.target ).find( 'input:not([type="hidden"],[type="submit"]), select' ).each( function () {
+                       var value = '';
+
                        if ( !$( this ).is( ':checkbox' ) || $( this ).is( ':checked' ) ) {
-                               data[ $( this ).prop( 'name' ) ] = $( this ).val();
+                               value = $( this ).val();
                        }
+
+                       data[ $( this ).prop( 'name' ) ] = value;
                } );
 
                this.controller.updateChangesList( data );
         * 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' ),
-                       collapseCookieName = 'changeslist-state';
+               var $namespaceSelect = this.$element.find( '#namespace' );
 
                this.$element.find( '.rcshowhideoption[data-feature-in-structured-ui=1]' ).each( function () {
                        // HACK: Remove the text node after the span.
                        this.$element.find( '.mw-tagfilter-label' ).closest( 'tr' ).detach();
                }
 
-               // Collapse legend
-               // see resources/src/mediawiki.special/mediawiki.special.changelist.legend.js
-               this.$element.find( '.mw-changeslist-legend' )
-                       .makeCollapsible( {
-                               collapsed: mw.cookie.get( collapseCookieName ) === 'collapsed'
-                       } )
-                       .on( 'beforeExpand.mw-collapsible', function () {
-                               mw.cookie.set( collapseCookieName, 'expanded' );
-                       } )
-                       .on( 'beforeCollapse.mw-collapsible', function () {
-                               mw.cookie.set( collapseCookieName, 'collapsed' );
-                       } );
-
+               if ( !this.$element.find( '.mw-recentchanges-table tr' ).length ) {
+                       this.$element.find( 'hr' ).detach();
+               }
        };
 }( mediaWiki ) );