* Notifications: if deleting all (visible) messages, directly return the next junk, to ease cleaning them up

This commit is contained in:
ralf 2024-04-11 16:39:31 +02:00
parent 5c6313448e
commit ef67e21930

View File

@ -570,9 +570,11 @@
notifications.prototype.delete_all = function () { notifications.prototype.delete_all = function () {
if (!notifymessages || Object.entries(notifymessages).length == 0) return false; if (!notifymessages || Object.entries(notifymessages).length == 0) return false;
egw.request("notifications.notifications_ajax.delete_message", [notifymessages.map(d => d.id)]); egw.request("notifications.notifications_ajax.delete_message", [Object.keys(notifymessages)]);
notifymessages = {}; notifymessages = {};
_currentRawData = []; // otherwise response from delete_message/get_notifications might not get parsed
this.total = 0; this.total = 0;
this.counterUpdate();
jQuery("#egwpopup_list").empty(); jQuery("#egwpopup_list").empty();
egw.loading_prompt('popup_notifications', false); egw.loading_prompt('popup_notifications', false);
this.bell("inactive"); this.bell("inactive");
@ -590,6 +592,7 @@
var keepLoadingPrompt = false; var keepLoadingPrompt = false;
delete (notifymessages[id]); delete (notifymessages[id]);
this.total -= 1; this.total -= 1;
this.counterUpdate();
if (nextNode.length > 0 && nextNode[0].id.match(/egwpopup_message_/ig) && egwpopup_message.hasClass('egwpopup_expanded')) if (nextNode.length > 0 && nextNode[0].id.match(/egwpopup_message_/ig) && egwpopup_message.hasClass('egwpopup_expanded'))
{ {
nextNode.trigger('click'); nextNode.trigger('click');