Wrap attempt at lang in try/catch for if egw.lang() isn't available

This commit is contained in:
Nathan Gray 2011-11-30 19:50:25 +00:00
parent 22034c81e4
commit a3d417b318

View File

@ -60,7 +60,11 @@ function egwpopup_display() {
if(window.webkitNotifications && window.webkitNotifications.checkPermission() != EGW_BROWSER_NOTIFY_ALLOWED &&
jQuery('#desktop_perms').length == 0)
{
var desktop_button = jQuery('<button id="desktop_perms">' + (egw?egw.lang('Desktop notifications') : 'Desktop notifications') + '</button>')
var label = 'Desktop notifications';
try {
if(egw) label = egw.lang(label);
} catch(err) {}
var desktop_button = jQuery('<button id="desktop_perms">' + label + '</button>')
.click(function() {
window.webkitNotifications.requestPermission();
jQuery(this).hide();