Commit d6925cb5 authored by Killian Kemps's avatar Killian Kemps
Browse files

Add notice when no notifications in panel

parent b4eed4c0
......@@ -244,6 +244,14 @@ h1 {
height: 100%;
}
#notificationPanel > p {
margin: 0px auto;
display: block;
position: relative;
top: 50%;
width: 250px;
}
.notification {
padding: 10px;
list-style-type: none;
......
......@@ -355,6 +355,7 @@ function NotificationPanel(mapping){
this.notificationPanel = mapping.notificationPanel;
this.buttonOpenNotificationPanel = mapping.buttonOpenNotificationPanel;
this.notificationPanelList = mapping.notificationPanel.getElementsByTagName('ul')[0];
this.noNotificationNotice = mapping.notificationPanel.getElementsByTagName('p')[0];
this.notificationsList = [];
this.notificationsCounter = mapping.notificationsCounter;
this.notificationCount = 0;
......@@ -448,6 +449,7 @@ NotificationPanel.prototype.createNotification = function(notification, noAlert)
var generatedNotification = notification.generateNotification();
this.notificationsList.unshift(generatedNotification);
this.notificationPanelList.insertBefore(generatedNotification, this.notificationPanelList.childNodes[0]);
this.noNotificationNotice.style.display = 'none';
if(!noAlert){
this.notificationsCounter.textContent = this.notificationCount = this.notificationCount + 1;
this.notificationsCounter.style.display = 'block';
......
......@@ -46,6 +46,7 @@
</div>
<div id="notificationPanel">
<p id="no-notifications-notice">You have currently no notifications.</p>
<ul id="notificationsList">
</ul>
</div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment