Browse Source

Update notification icon when marking read (#499)

master
Federico Brigante 7 years ago
committed by GitHub
parent
commit
f073dd2857
  1. 5
      extension/content.css
  2. 8
      src/libs/mark-unread.js

5
extension/content.css

@ -646,11 +646,6 @@ div.inline-comment-form .form-actions,
margin-top: 5px;
}
/* Display notification bell icon for bookmarked Issues/PR */
.notification-indicator .mail-status.local-unread{
display: inline-block;
}
/* Decrease the size of the search box to fit 'Yours' menu item */
.subnav-search-input[aria-label="Search all issues"] {
width: 420px;

8
src/libs/mark-unread.js

@ -236,11 +236,11 @@ function getUserName() {
function unreadIndicatorIcon() {
const notificationIndicator = select('.header-nav-link.notification-indicator');
const notificationStatus = notificationIndicator.querySelector('.mail-status');
const hasUnread = select.exists('li.js-notification.unread') || loadNotifications().length > 0;
const label = hasUnread ? 'You have unread notifications' : 'You have no unread notifications';
if (loadNotifications().length > 0) {
notificationStatus.classList.add('local-unread');
notificationIndicator.setAttribute('aria-label', 'You have unread notifications');
}
notificationStatus.classList.toggle('unread', hasUnread);
notificationIndicator.setAttribute('aria-label', label);
}
function markNotificationRead(e) {

Loading…
Cancel
Save