From 8efb4381fab5271bad5cb1081e3d035ad6d5c11d Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Fri, 23 Apr 2021 13:02:14 +0200 Subject: [PATCH] Fix notifications low verbosity does not stop ringing bell animation after notification being deleted or all being deleted --- notifications/js/notificationajaxpopup.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/notifications/js/notificationajaxpopup.js b/notifications/js/notificationajaxpopup.js index 7fa5a266d0..89498fcf49 100644 --- a/notifications/js/notificationajaxpopup.js +++ b/notifications/js/notificationajaxpopup.js @@ -578,6 +578,7 @@ notifymessages = {}; jQuery("#egwpopup_list").empty(); egw.loading_prompt('popup_notifications', false); + this.bell("inactive"); }; /** @@ -752,7 +753,10 @@ switch(egw.preference('egwpopup_verbosity', 'notifications')) { case 'low': - this.bell('active'); + if (Object.keys(notifymessages).length>0 && this.counterUpdate()>0) + { + this.bell('active'); + } break; case 'high': if (hasUnseen.length > 0) @@ -850,6 +854,7 @@ /** * Set new state of notifications counter + * @return number of new messages */ notifications.prototype.counterUpdate = function () { @@ -890,6 +895,7 @@ { framework.topmenu_info_notify('notifications', false); } + return counter; }; var lab = egw_LAB || $LAB;