Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Hiding the notification bar when there is nothing to be shown.

  • Loading branch information...
commit 7ddc317bd1bce35937910aa99cf6965923c4c83e 1 parent 367d5ba
@etiennesegonzac authored
View
13 apps/homescreen/js/homescreen.js
@@ -689,8 +689,8 @@ var MessagesListener = function() {
while (notifications.hasChildNodes())
notifications.removeChild(notifications.firstChild);
- showMessage('', 'Waiting for notifications...');
-
+ notifications.classList.add('hidden');
+
var sender = notifications.dataset.sender;
WindowManager.launch('../sms/sms.html?sender=' + sender);
});
@@ -708,16 +708,13 @@ var MessagesListener = function() {
var message = document.createElement('div');
message.textContent = body;
- if (sender == '') {
- title.classList.add('empty');
- message.classList.add('empty');
- }
-
notification.appendChild(title);
notification.appendChild(message);
notifications.appendChild(notification);
notifications.dataset.sender = sender;
+
+ notifications.classList.remove('hidden');
}
@@ -726,7 +723,7 @@ var MessagesListener = function() {
showMessage(message.sender, message.body);
});
- showMessage('', 'Waiting for notifications...');
+ notifications.classList.add('hidden');
};
/* === TelephoneListener === */
View
34 apps/homescreen/style/homescreen.css
@@ -107,6 +107,12 @@ body {
background-size: 100% 100%;
border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px;
+
+ -moz-transition: -moz-transform 0.3s ease;
+}
+
+#home > #notifications.hidden {
+ -moz-transform: translateY(80px);
}
#home .notification {
@@ -115,29 +121,25 @@ body {
}
#home .notification > div:first-child {
- padding: 5px 0 0 0;
- height: 25px;
+ margin: 0;
+ padding: 20px 0 0 0;
+
font-size: 2.5mozmm;
+ line-height: 2.5mozmm;
color: #111;
}
#home .notification > div:last-child {
- display: table-cell;
+ margin: 0;
+ padding: 0;
+ width: -moz-calc(100% - 20px);
+ height: 25px;
+
font-size: 2mozmm;
- height: 50px;
color: #666;
- overflow: scroll;
- vertical-align: middle;
-}
-
-#home .notification > div:first-child.empty {
- display: none;
-}
-
-#home .notification > div:last-child.empty {
- line-height: 80px;
- height: 80px;
- color: #aaa;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
}
.page {
Please sign in to comment.
Something went wrong with that request. Please try again.