Move the legend from the fieldset area to the results area.
Bug: T168043
Change-Id: I40454b194fe3975d8d4ac13d96774bfa5b5d5a46
$userShowHiddenCats = $this->getUser()->getBoolOption( 'showhiddencats' );
$rclistOutput = $list->beginRecentChangesList();
+ if ( $this->isStructuredFilterUiEnabled() ) {
+ $rclistOutput .= $this->makeLegend();
+ }
+
foreach ( $rows as $obj ) {
if ( $limit == 0 ) {
break;
$nondefaults = $opts->getChangedValues();
$panel = [];
- $panel[] = $this->makeLegend();
+ if ( !$this->isStructuredFilterUiEnabled() ) {
+ $panel[] = $this->makeLegend();
+ }
$panel[] = $this->optionsPanel( $defaults, $nondefaults, $numRows );
$panel[] = '<hr />';
* 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.
if ( !this.$element.find( '.mw-recentchanges-table tr' ).length ) {
this.$element.find( 'hr' ).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' );
- } );
-
};
}( mediaWiki ) );
var
cookieName = 'changeslist-state',
// Expanded by default
- isCollapsed = mw.cookie.get( cookieName ) === 'collapsed';
+ isCollapsed = mw.cookie.get( cookieName ) === 'collapsed',
+ doCollapsibleLegend = function ( $container ) {
+ $container.find( '.mw-changeslist-legend' )
+ .makeCollapsible( {
+ collapsed: isCollapsed
+ } )
+ .on( 'beforeExpand.mw-collapsible', function () {
+ mw.cookie.set( cookieName, 'expanded' );
+ } )
+ .on( 'beforeCollapse.mw-collapsible', function () {
+ mw.cookie.set( cookieName, 'collapsed' );
+ } );
+ };
$( function () {
- $( '.mw-changeslist-legend' )
- .makeCollapsible( {
- collapsed: isCollapsed
- } )
- .on( 'beforeExpand.mw-collapsible', function () {
- mw.cookie.set( cookieName, 'expanded' );
- } )
- .on( 'beforeCollapse.mw-collapsible', function () {
- mw.cookie.set( cookieName, 'collapsed' );
- } );
+ mw.hook( 'wikipage.content' ).add( doCollapsibleLegend );
} );
}( mediaWiki, jQuery ) );