From 19a3524ab5952572b86ce140e41f916e0db9b725 Mon Sep 17 00:00:00 2001 From: ClemDee Date: Thu, 27 Jun 2019 11:37:13 +0200 Subject: [PATCH] Add no-notifications indicator when list empty --- www/notifications/app-notifications.less | 13 +++++++++++-- www/notifications/inner.js | 4 +++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/www/notifications/app-notifications.less b/www/notifications/app-notifications.less index 543b2550e..b8b2c1f67 100644 --- a/www/notifications/app-notifications.less +++ b/www/notifications/app-notifications.less @@ -77,8 +77,17 @@ justify-content: flex-start; align-items: center; background-color: #ffffff; - &:not(:last-child) { - border-bottom: 1px solid #ccc; + &.no-notifications { + display: none; + padding: 1rem 1rem; + font-style: italic; + color: #777; + &:only-child { + display: block; + } + } + &:not(:first-child) { + border-top: 1px solid #ccc; } .cp-notification-content { diff --git a/www/notifications/inner.js b/www/notifications/inner.js index a953b796f..d75293ce3 100644 --- a/www/notifications/inner.js +++ b/www/notifications/inner.js @@ -65,7 +65,9 @@ define([ dismissAll = h("div.cp-app-notifications-dismissall.cp-clickable", { title: Messages.dismissAll || "Dismiss All" }, h("span.fa.fa-trash")), ]), ]), - notifsList = h("div.cp-app-notifications-panel-list"), + notifsList = h("div.cp-app-notifications-panel-list", [ + h("div.cp-notification.no-notifications", Messages.notifications_empty), + ]), ]); $div.append(notifsPanel);