Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Bug 1073480 - Remove the notifications counter
Browse files Browse the repository at this point in the history
  • Loading branch information
albertopq authored and rvandermeulen committed Oct 15, 2014
1 parent a3183ce commit b2dedf0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 64 deletions.
16 changes: 1 addition & 15 deletions apps/system/js/notifications.js
Expand Up @@ -677,8 +677,7 @@ var NotificationScreen = {

updateNotificationIndicator: function ns_updateNotificationIndicator() {
if (this.unreadNotifications.length) {
var indicatorSize = getIndicatorSize(this.unreadNotifications.length);
this.ambientIndicator.className = 'unread ' + indicatorSize;
this.ambientIndicator.className = 'unread';
this.ambientIndicator.setAttribute('aria-label', navigator.mozL10n.get(
'statusbarNotifications-unread', {n: this.unreadNotifications.length}));
} else {
Expand Down Expand Up @@ -774,19 +773,6 @@ var NotificationScreen = {

};

function getIndicatorSize(count) {
if (!count || count <= 2)
return 'small';

if (count <= 4)
return 'medium';

if (count <= 6)
return 'big';

return 'full';
}

window.addEventListener('load', function() {
window.removeEventListener('load', this);
if ('mozSettings' in navigator && navigator.mozSettings) {
Expand Down
23 changes: 2 additions & 21 deletions apps/system/style/notifications/notifications.css
Expand Up @@ -118,13 +118,12 @@
height: .2rem;
width: 100%;
opacity: 0;
background-color: #00BCE2;
background-color: #00D3FF;
transform: translateY(-.2rem);
transition: opacity .5s ease .5s, transform 0s ease 1s, background-color 0s ease 1s;
}

#notification-toaster.displayed:after,
#ambient-indicator:after {
#notification-toaster.displayed:after {
position: absolute;
right: 0;
left: 0;
Expand All @@ -150,29 +149,11 @@
}

#ambient-indicator.unread {
background-color: #006e86;
transform: translateY(0);
transition: background-color .3s ease .3s;
opacity: 1;
}

#ambient-indicator.small:after {
width: 8.6rem;
}

#ambient-indicator.medium:after {
width: 16.8rem;
}

#ambient-indicator.big:after {
width: 24.8rem;
}

#ambient-indicator.full:after {
width: 100%;
background-color: white;
}

#notification-bar {
height: 4.5rem;
}
Expand Down
28 changes: 0 additions & 28 deletions apps/system/test/unit/notifications_test.js
Expand Up @@ -262,34 +262,6 @@ suite('system/NotificationScreen >', function() {
'aria-label'));
});

test('should show a small ambient indicator', function() {
incrementNotications(2);
assert.equal(document.body.getElementsByClassName('small').length, 1);
assert.equal(NotificationScreen.ambientIndicator.getAttribute(
'aria-label'), localizeAmbientIndicatorLabel(2));
});

test('should show a medium ambient indicator', function() {
incrementNotications(4);
assert.equal(document.body.getElementsByClassName('medium').length, 1);
assert.equal(NotificationScreen.ambientIndicator.getAttribute(
'aria-label'), localizeAmbientIndicatorLabel(4));
});

test('should show a big ambient indicator', function() {
incrementNotications(6);
assert.equal(document.body.getElementsByClassName('big').length, 1);
assert.equal(NotificationScreen.ambientIndicator.getAttribute(
'aria-label'), localizeAmbientIndicatorLabel(6));
});

test('should show a full ambient indicator', function() {
incrementNotications(7);
assert.equal(document.body.getElementsByClassName('full').length, 1);
assert.equal(NotificationScreen.ambientIndicator.getAttribute(
'aria-label'), localizeAmbientIndicatorLabel(7));
});

test('should change the read status', function() {
incrementNotications(1);
assert.equal(document.body.getElementsByClassName('unread').length, 1);
Expand Down

0 comments on commit b2dedf0

Please sign in to comment.