From de4997b2d381e91e4a08c087656a8c398066a4ef Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Thu, 27 Jan 2022 14:42:38 +0530 Subject: [PATCH 1/2] fix: Close notification when any notification item is clicked --- .../public/js/frappe/ui/notifications/notifications.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frappe/public/js/frappe/ui/notifications/notifications.js b/frappe/public/js/frappe/ui/notifications/notifications.js index 6fa8303574..35b1bed14e 100644 --- a/frappe/public/js/frappe/ui/notifications/notifications.js +++ b/frappe/public/js/frappe/ui/notifications/notifications.js @@ -283,12 +283,13 @@ class NotificationsView extends BaseNotificationsView { e.stopImmediatePropagation(); this.mark_as_read(field.name, item_html); }); - - item_html.on('click', () => { - this.mark_as_read(field.name, item_html); - }); } + item_html.on('click', () => { + !field.read && this.mark_as_read(field.name, item_html); + this.notifications_icon.trigger('click') + }); + return item_html; } From 2500d2c5873b98f5ce9acdb25b80d37990801b11 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Thu, 27 Jan 2022 15:00:57 +0530 Subject: [PATCH 2/2] fix: sider fix --- frappe/public/js/frappe/ui/notifications/notifications.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/ui/notifications/notifications.js b/frappe/public/js/frappe/ui/notifications/notifications.js index 35b1bed14e..bf1cee2cbf 100644 --- a/frappe/public/js/frappe/ui/notifications/notifications.js +++ b/frappe/public/js/frappe/ui/notifications/notifications.js @@ -287,7 +287,7 @@ class NotificationsView extends BaseNotificationsView { item_html.on('click', () => { !field.read && this.mark_as_read(field.name, item_html); - this.notifications_icon.trigger('click') + this.notifications_icon.trigger('click'); }); return item_html;