From 93f9fe9684d9f4d0c5025dce02d8d2cc016734b1 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 30 Nov 2021 17:00:02 +0100 Subject: [PATCH] update indicator when table is updated --- .../InvenTree/notifications/notifications.html | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/InvenTree/templates/InvenTree/notifications/notifications.html b/InvenTree/templates/InvenTree/notifications/notifications.html index 503c492ac3..e6f73db356 100644 --- a/InvenTree/templates/InvenTree/notifications/notifications.html +++ b/InvenTree/templates/InvenTree/notifications/notifications.html @@ -102,7 +102,19 @@ function loadNotificationTable(table, options={}) { inventreePut(url, {}, { method: 'POST', - success: function() { updateNotificationTables(); } + success: function() { + updateNotificationTables(); + + // update current notification count + var count = parseInt($("#notification-counter").html()); + if ($(this).attr('target') == 'read') { + count = count - 1; + } else { + count = count + 1; + } + // update notification indicator now + updateNotificationIndicator(count); + } }); }); }