From 4283e1122eb105c0d0c2bd7ce5abe2add19f65c4 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 1 Dec 2011 16:20:00 +0000 Subject: [PATCH] Allow browser to notify even if verbosity is low, in case browser is not visible --- .../inc/class.notifications_ajax.inc.php | 2 +- notifications/js/notificationajaxpopup.js | 21 +++++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/notifications/inc/class.notifications_ajax.inc.php b/notifications/inc/class.notifications_ajax.inc.php index e8f1b2ea7f..066d5314e1 100644 --- a/notifications/inc/class.notifications_ajax.inc.php +++ b/notifications/inc/class.notifications_ajax.inc.php @@ -263,7 +263,7 @@ class notifications_ajax { if ($rs->NumRows() > 0) { foreach ($rs as $notification) { $message = null; - if($browserNotify && $this->preferences[self::_appname]['egwpopup_verbosity'] != 'low') + if($browserNotify) { $message = $notification['notify_message']; diff --git a/notifications/js/notificationajaxpopup.js b/notifications/js/notificationajaxpopup.js index d78b0a3ce4..e7c5311593 100644 --- a/notifications/js/notificationajaxpopup.js +++ b/notifications/js/notificationajaxpopup.js @@ -131,13 +131,16 @@ function append_notification_message(_id, _message, _browser_notify) { notifymessages[_id] = _message; // Notification API - var notice = webkitNotifications.createHTMLNotification(_browser_notify); - notice.ondisplay = function() { - // Confirm when user gets to see it - no close needed - // Wait a bit to let it load first, or it might not be there when requested. - window.setTimeout( function() { - xajax_doXMLHTTP("notifications.notifications_ajax.confirm_message", _id); - }, 2000); - }; - notice.show(); + if(_browser_notify) + { + var notice = webkitNotifications.createHTMLNotification(_browser_notify); + notice.ondisplay = function() { + // Confirm when user gets to see it - no close needed + // Wait a bit to let it load first, or it might not be there when requested. + window.setTimeout( function() { + xajax_doXMLHTTP("notifications.notifications_ajax.confirm_message", _id); + }, 2000); + }; + notice.show(); + } }