Merge "Always collapse Echo alert on "wide" headers"

This commit is contained in:
jenkins-bot 2022-04-20 16:39:12 +00:00 committed by Gerrit Code Review
commit cdc2df8e66
3 changed files with 19 additions and 5 deletions

View File

@ -365,7 +365,9 @@ abstract class SkinVector extends SkinMustache {
$userMenuData[ 'html-after-portal' ] .= $this->getLogoutHTML();
}
$moreItems = substr_count( $userMoreData['html-items'], '<li' );
return [
'is-wide' => $moreItems > 3,
'data-user-more' => $userMoreData,
'data-user-menu' => $userMenuData
];

View File

@ -1,4 +1,4 @@
<div class="vector-user-links">
<div class="vector-user-links{{#is-wide}} vector-user-links-wide{{/is-wide}}">
{{#data-user-more}}{{>Menu}}{{/data-user-more}}
{{#data-user-menu}}{{>Menu}}{{/data-user-menu}}
</div>

View File

@ -1,5 +1,13 @@
@import '../resources/common/variables.less';
/** Mixin for collapsing the Echo new messages alert */
.echo-alert-collapse() {
font-size: 12px;
position: absolute;
top: 100%;
right: 0;
}
.vector-user-links {
.vector-menu-content-list {
.mw-echo-alert {
@ -17,11 +25,15 @@
@media ( max-width: @width-breakpoint-desktop-wide ) {
.mw-echo-alert {
font-size: 12px;
position: absolute;
top: 100%;
right: 0;
.echo-alert-collapse();
}
}
}
}
// If the user link is wide, always collapse
.vector-user-links-wide .vector-menu-content-list {
.mw-echo-alert {
.echo-alert-collapse();
}
}