Fix a bug notifications sidebar in client-side not being translated

This commit is contained in:
Hadi Nategh
2018-01-11 17:23:58 +01:00
parent 294e7f16b0
commit 929676793c
3 changed files with 28 additions and 17 deletions

View File

@ -559,20 +559,24 @@
var lab = egw_LAB || $LAB;
var self = notifications;
lab.wait(function(){
if (typeof window.app == 'undefined') window.app = {};
window.app.notifications = new self();
// 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(){
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()});
var langRequire = jQuery('#notifications_script_id').attr('data-langRequire');
egw.langRequire(window, [JSON.parse(langRequire)], function()
{
if (typeof window.app == 'undefined') window.app = {};
window.app.notifications = new self();
// 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(){
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()});
}, this);
});
})();