feature(dom) Notify send: add getConfig

This commit is contained in:
coderaiser 2013-11-15 12:25:12 +00:00
parent f381549534
commit 17cd636f1f

View file

@ -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 () {