update indicator when table is updated

This commit is contained in:
Matthias 2021-11-30 17:00:02 +01:00
parent c8efc26f58
commit 93f9fe9684
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -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);
}
});
});
}