From b137c628156d3a605d26052b527c77dab0b117b5 Mon Sep 17 00:00:00 2001 From: A Sigalas Date: Wed, 23 Aug 2017 11:27:42 +0000 Subject: [PATCH 1/2] Added popup warning before deleting all notifications --- notifications/js/notificationajaxpopup.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/notifications/js/notificationajaxpopup.js b/notifications/js/notificationajaxpopup.js index 634b4436a2..250fdda28b 100644 --- a/notifications/js/notificationajaxpopup.js +++ b/notifications/js/notificationajaxpopup.js @@ -365,7 +365,10 @@ // toggle notifications bar jQuery('.egwpopup_toggle').click(function(){window.app.notifications.toggle();}); jQuery('#egwpopup_fw_notifications').click(function(){window.app.notifications.toggle();}); - jQuery(".egwpopup_deleteall", '#egwpopup').click(function(){window.app.notifications.delete_all()}); + jQuery(".egwpopup_deleteall", '#egwpopup').click(function(){ + if ( confirm(egw.lang('Are you sure you want to delete all notifications?')) ) + window.app.notifications.delete_all() + }); jQuery(".egwpopup_seenall", '#egwpopup').click(function(){window.app.notifications.mark_all_seen()}); }); })(); From e966ae332a1ec54b58cd670078ebf12d8775a678 Mon Sep 17 00:00:00 2001 From: A Sigalas Date: Wed, 23 Aug 2017 13:15:55 +0000 Subject: [PATCH 2/2] Using et2_dialog for popup --- notifications/js/notificationajaxpopup.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/notifications/js/notificationajaxpopup.js b/notifications/js/notificationajaxpopup.js index 250fdda28b..a44bda3444 100644 --- a/notifications/js/notificationajaxpopup.js +++ b/notifications/js/notificationajaxpopup.js @@ -366,8 +366,13 @@ jQuery('.egwpopup_toggle').click(function(){window.app.notifications.toggle();}); jQuery('#egwpopup_fw_notifications').click(function(){window.app.notifications.toggle();}); jQuery(".egwpopup_deleteall", '#egwpopup').click(function(){ - if ( confirm(egw.lang('Are you sure you want to delete all notifications?')) ) - window.app.notifications.delete_all() + et2_dialog.show_dialog( function(_button){ + if (_button == 2) window.app.notifications.delete_all(); + }, + egw.lang('Are you sure you want to delete all notifications?'), + egw.lang('Delete notifications'), + null, et2_dialog.BUTTON_YES_NO, et2_dialog.WARNING_MESSAGE, undefined, egw + ); }); jQuery(".egwpopup_seenall", '#egwpopup').click(function(){window.app.notifications.mark_all_seen()}); });