Make the RC/Watchlist legend not jump when initially collapsed
[lhc/web/wiklou.git] / includes / specialpage / ChangesListSpecialPage.php
index 88ec327..dcd14e8 100644 (file)
@@ -1467,8 +1467,10 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                        $context->msg( 'recentchanges-legend-heading' )->parse();
 
                # Collapsible
+               $collapsedState = $this->getRequest()->getCookie( 'changeslist-state' );
+               $collapsedClass = $collapsedState === 'collapsed' ? ' mw-collapsed' : '';
                $legend =
-                       '<div class="mw-changeslist-legend">' .
+                       '<div class="mw-changeslist-legend mw-collapsible' . $collapsedClass . '">' .
                                $legendHeading .
                                '<div class="mw-collapsible-content">' . $legend . '</div>' .
                        '</div>';