mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-27 00:09:40 +01:00
Check and ask for the notification permission if nothing yet set
This commit is contained in:
parent
f01d6bc404
commit
b1e666245a
@ -93,10 +93,16 @@ egw.extend('notification', egw.MODULE_WND_LOCAL, function(_app, _wnd)
|
||||
|
||||
/**
|
||||
* Check Notification availability by browser
|
||||
*
|
||||
*
|
||||
* @returns {Boolean} true if notification is supported and permitted otherwise false
|
||||
*/
|
||||
checkNotification: function () {
|
||||
// Ask for permission if there's nothing decided yet
|
||||
if (Notification && Notification.requestPermission && permission == 'default') {
|
||||
Notification.requestPermission (function(_permission){
|
||||
permission = _permission;
|
||||
});
|
||||
}
|
||||
return (Notification && Notification.requestPermission && permission == 'granted');
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user