- Use link registry to open notification links

- Fix mark all notifications as read on popup close
This commit is contained in:
Nathan Gray
2014-12-15 19:09:22 +00:00
parent cc71329be0
commit da3d0d23c4
4 changed files with 36 additions and 8 deletions

View File

@ -83,6 +83,20 @@
egwpopup_message.style.maxHeight = (Browserheight/2) + "px";
for(var show in notifymessages) break;
egwpopup_message.innerHTML = notifymessages[show];
// Activate links
$j('div[data-id],div[data-url]', egwpopup_message).on('click',
function() {
if(this.dataset.id)
{
egw.open(this.dataset.id,this.dataset.app);
}
else
{
egw.open_link(this.dataset.url,'_blank',this.dataset.popup);
}
}
).addClass('et2_link');
var num = 0;
for(var id in notifymessages) ++num;
if(num-1 > 0 ) {
@ -154,7 +168,7 @@
for(var id in notifymessages) {
ids.push(id);
}
var request = egw.json("notifications.notifications_ajax.confirm_message", ids);
var request = egw.json("notifications.notifications_ajax.confirm_message", [ids]);
request.sendRequest();
notifymessages = {};
var egwpopup = document.getElementById("egwpopup");