Catrope has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/381151 )
Change subject: Make the RC/Watchlist legend not jump when initially collapsed ...................................................................... Make the RC/Watchlist legend not jump when initially collapsed Look at the collapsed/expanded cookie and add class="mw-collapsed" if it's going to be collapsed. This is kind of a prelude to T42812. Change-Id: Icaca762a9d7b000c973d9275f395623129f67979 --- M includes/specialpage/ChangesListSpecialPage.php M resources/src/mediawiki.special/mediawiki.special.changeslist.css 2 files changed, 9 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/51/381151/1 diff --git a/includes/specialpage/ChangesListSpecialPage.php b/includes/specialpage/ChangesListSpecialPage.php index 88ec327..f3ace6f 100644 --- a/includes/specialpage/ChangesListSpecialPage.php +++ b/includes/specialpage/ChangesListSpecialPage.php @@ -1467,8 +1467,11 @@ $context->msg( 'recentchanges-legend-heading' )->parse(); # Collapsible + $collapsedState = $this->getRequest()->getCookie( 'changeslist-state' ); + // Note that an empty/unset cookie means collapsed, so check for !== 'expanded' + $collapsedClass = $collapsedState !== 'expanded' ? ' 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>'; diff --git a/resources/src/mediawiki.special/mediawiki.special.changeslist.css b/resources/src/mediawiki.special/mediawiki.special.changeslist.css index 3e1bd4e..532ca86 100644 --- a/resources/src/mediawiki.special/mediawiki.special.changeslist.css +++ b/resources/src/mediawiki.special/mediawiki.special.changeslist.css @@ -39,3 +39,8 @@ unicode-bidi: -moz-isolate; unicode-bidi: isolate; } + +/* Prevent FOUC if legend is initially collapsed */ +.mw-changeslist-legend.mw-collapsed .mw-collapsible-content { + display: none; +} -- To view, visit https://gerrit.wikimedia.org/r/381151 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icaca762a9d7b000c973d9275f395623129f67979 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Catrope <r...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits