mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 13:09:21 +03:00
Clickable notifications (#745)
This commit is contained in:
parent
69c01e5789
commit
9ade5a585b
5 changed files with 121 additions and 39 deletions
|
|
@ -8,6 +8,7 @@
|
|||
ko = require('ko'),
|
||||
|
||||
Enums = require('Common/Enums'),
|
||||
Events = require('Common/Events'),
|
||||
Audio = require('Common/Audio'),
|
||||
|
||||
Settings = require('Storage/Settings')
|
||||
|
|
@ -161,7 +162,7 @@
|
|||
}
|
||||
};
|
||||
|
||||
NotificationUserStore.prototype.displayDesktopNotification = function (sImageSrc, sTitle, sText)
|
||||
NotificationUserStore.prototype.displayDesktopNotification = function (sImageSrc, sTitle, sText, oMessageData)
|
||||
{
|
||||
if (this.enableDesktopNotification())
|
||||
{
|
||||
|
|
@ -180,6 +181,19 @@
|
|||
oNotification.show();
|
||||
}
|
||||
|
||||
if (oMessageData)
|
||||
{
|
||||
oNotification.onclick = function () {
|
||||
|
||||
window.focus();
|
||||
|
||||
if (oMessageData.Folder && oMessageData.Uid)
|
||||
{
|
||||
Events.pub('mailbox.message.show', [oMessageData.Folder, oMessageData.Uid]);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
window.setTimeout((function (oLocalNotifications) {
|
||||
return function () {
|
||||
if (oLocalNotifications.cancel)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue