Commit 061f757f authored by Gaëlle Morin's avatar Gaëlle Morin

ui: add a new template to display the counter of unread notifications + style...

ui: add a new template to display the counter of unread notifications + style on notification__button
parent db361bb6
Pipeline #2621 passed with stage
in 27 seconds
......@@ -31,6 +31,11 @@
outline: none;
border-radius: 5px;
}
.sib-notifications__button::before {
background-image: url("./img/notification-icon.svg");
background-repeat: no-repeat;
content: "";
}
.sib-notifications__button::-webkit-details-marker {
display: none
}
......
......@@ -81,15 +81,6 @@ class SIBNotifications extends SIBTemplateElement {
// Update favicon
this.favicon.badge(unread)
// Update badge icon
let badgeUnread = this.querySelector('#badge-unread')
if (unread > 0) {
badgeUnread.innerText = unread
badgeUnread.style.display = 'block'
} else {
badgeUnread.style.display = 'none'
}
}
_getNotificationsList() {
......@@ -108,8 +99,15 @@ class SIBNotifications extends SIBTemplateElement {
<div class="sib-notifications">
<details class="sib-notifications__container">
<summary class="sib-notifications__button">
<img src="./img/notification-icon.svg" />
<div class="sib-notifications__counter" id="badge-unread"></div>
<sib-display
class="sib-notifications__counter"
data-src="${sourceUrl}"
data-fields=""
search-fields="read"
search-value-read="false"
search-widget-read="sib-form-hidden"
counter-template="<div class='xxx'>\${counter}</div>"
></sib-display>
</summary>
<div class="sib-notifications__list">
<sib-display
......
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