mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
feature(dom) Notify send: add getConfig
This commit is contained in:
parent
f381549534
commit
17cd636f1f
1 changed files with 15 additions and 12 deletions
|
|
@ -643,7 +643,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
};
|
||||
},
|
||||
NotifyProto = function() {
|
||||
var Show, Notify = this;
|
||||
var Show, Allow, Notify = this;
|
||||
|
||||
Events.add({
|
||||
'blur' :function() {
|
||||
|
|
@ -655,17 +655,20 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
|||
}, window);
|
||||
|
||||
this.send = function(msg) {
|
||||
var notify,
|
||||
focus = window.focus.bind(window),
|
||||
granted = Notify.check();
|
||||
|
||||
if (granted && Show) {
|
||||
notify = new Notification(msg, {
|
||||
icon: '/img/favicon/favicon-notify.png',
|
||||
});
|
||||
|
||||
Events.addClick(focus, notify);
|
||||
}
|
||||
CloudCmd.getConfig(function(config) {
|
||||
var notify,
|
||||
notifications = config.notifications,
|
||||
focus = window.focus.bind(window),
|
||||
granted = Notify.check();
|
||||
|
||||
if (notifications && granted && Show) {
|
||||
notify = new Notification(msg, {
|
||||
icon: '/img/favicon/favicon-notify.png',
|
||||
});
|
||||
|
||||
Events.addClick(focus, notify);
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
this.check = function () {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue