$topLinksAttributes = [ 'class' => 'mw-recentchanges-toplinks' ];
if ( $this->isStructuredFilterUiEnabled() ) {
+ // Check whether the widget is already collapsed or expanded
+ $collapsedState = $this->getRequest()->getCookie( 'rcfilters-toplinks-collapsed-state' );
+ $collapsedClass = $collapsedState === 'collapsed' ? 'mw-rcfilters-toplinks-collapsed' : '';
+
$contentTitle = Html::rawElement( 'div',
- [ 'class' => 'mw-recentchanges-toplinks-title' ],
+ [ 'class' => 'mw-recentchanges-toplinks-title ' . $collapsedClass ],
$this->msg( 'rcfilters-other-review-tools' )->parse()
);
$contentWrapper = Html::rawElement( 'div',
- array_merge( [ 'class' => 'mw-collapsible-content' ], $langAttributes ),
+ array_merge(
+ [
+ 'class' => 'mw-recentchanges-toplinks-content mw-collapsible-content ' .
+ $collapsedClass
+ ],
+ $langAttributes
+ ),
$content
);
$content = $contentTitle . $contentWrapper;
.rcfilters-head {
min-height: @rcfilters-head-min-height;
}
+
// On the watchlist, reserve a bit more
.mw-special-Watchlist .rcfilters-head {
min-height: @rcfilters-wl-head-min-height;
}
- body:not( .mw-rcfilters-ui-initialized ) .rcfilters-head {
- opacity: 0.5;
- pointer-events: none;
-
- .cloptions {
+ body:not( .mw-rcfilters-ui-initialized ) {
+ .mw-recentchanges-toplinks-content.mw-rcfilters-toplinks-collapsed {
display: none;
}
+
+ .mw-recentchanges-toplinks-title.mw-rcfilters-toplinks-collapsed {
+ // Hide, but keep the placement so we don't jump
+ visibility: hidden;
+ }
+
+ .rcfilters-head {
+ opacity: 0.5;
+ pointer-events: none;
+
+ .cloptions {
+ display: none;
+ }
+
+ }
}
.rcfilters-container {