mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-12 09:26:05 +00:00
Merge "Adjust unread counter position based on length"
This commit is contained in:
commit
f8fc22bada
|
@ -937,6 +937,10 @@ class EchoHooks {
|
|||
$msgLinkClasses[] = 'mw-echo-notifications-badge-all-read';
|
||||
}
|
||||
|
||||
if ( $msgCount > MWEchoNotifUser::MAX_BADGE_COUNT ) {
|
||||
$msgLinkClasses[] = 'mw-echo-notifications-badge-long-label';
|
||||
}
|
||||
|
||||
if (
|
||||
$alertCount != 0 && // no unread notifications
|
||||
$alertNotificationTimestamp !== false && // should already always be false if count === 0
|
||||
|
@ -948,6 +952,10 @@ class EchoHooks {
|
|||
$alertLinkClasses[] = 'mw-echo-notifications-badge-all-read';
|
||||
}
|
||||
|
||||
if ( $msgCount > MWEchoNotifUser::MAX_BADGE_COUNT ) {
|
||||
$alertLinkClasses[] = 'mw-echo-notifications-badge-long-label';
|
||||
}
|
||||
|
||||
$alertLink = [
|
||||
'href' => $url,
|
||||
'text' => $alertText,
|
||||
|
|
|
@ -58,6 +58,12 @@
|
|||
color: #fff;
|
||||
}
|
||||
|
||||
&.mw-echo-notifications-badge-long-label {
|
||||
&:after {
|
||||
left: 35%;
|
||||
}
|
||||
}
|
||||
|
||||
&.mw-echo-notifications-badge-all-read {
|
||||
opacity: 0.625;
|
||||
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
|
||||
this.$element
|
||||
.toggleClass( 'mw-echo-notifications-badge-all-read', !numItems )
|
||||
.toggleClass( 'mw-echo-notifications-badge-long-label', label.length > 2 )
|
||||
.attr( 'data-counter-num', numItems )
|
||||
.attr( 'data-counter-text', label );
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue