-
- // 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( '.rcshowhide' ).contents().length ) {
+ this.$element.find( '.rcshowhide' ).detach();
+ // If we're hiding rcshowhide, the '<br>'s are around it,
+ // there's no need for them either.
+ this.$element.find( 'br' ).detach();
+ }