[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make the RC/Watchlist legend not jump when initially collapsed

2017-09-28 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
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, 8 insertions(+), 1 deletion(-)

Approvals:
  Sbisson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/specialpage/ChangesListSpecialPage.php 
b/includes/specialpage/ChangesListSpecialPage.php
index 88ec327..dcd14e8 100644
--- a/includes/specialpage/ChangesListSpecialPage.php
+++ b/includes/specialpage/ChangesListSpecialPage.php
@@ -1467,8 +1467,10 @@
$context->msg( 'recentchanges-legend-heading' 
)->parse();
 
# Collapsible
+   $collapsedState = $this->getRequest()->getCookie( 
'changeslist-state' );
+   $collapsedClass = $collapsedState === 'collapsed' ? ' 
mw-collapsed' : '';
$legend =
-   '' .
+   '' .
$legendHeading .
'' . 
$legend . '' .
'';
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: merged
Gerrit-Change-Id: Icaca762a9d7b000c973d9275f395623129f67979
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Catrope 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: Jack Phoenix 
Gerrit-Reviewer: Krinkle 
Gerrit-Reviewer: Sbisson 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make the RC/Watchlist legend not jump when initially collapsed

2017-09-27 Thread Catrope (Code Review)
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 =
-   '' .
+   '' .
$legendHeading .
'' . 
$legend . '' .
'';
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 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits