mirror of https://github.com/OCA/web.git
[IMP] web_notify: black, isort, prettier
parent
f37984929f
commit
68323c9be8
|
@ -1,4 +1,4 @@
|
||||||
odoo.define("web_notify.WebClient", function(require) {
|
odoo.define("web_notify.WebClient", function (require) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var WebClient = require("web.WebClient");
|
var WebClient = require("web.WebClient");
|
||||||
|
@ -6,12 +6,12 @@ odoo.define("web_notify.WebClient", function(require) {
|
||||||
require("bus.BusService");
|
require("bus.BusService");
|
||||||
|
|
||||||
WebClient.include({
|
WebClient.include({
|
||||||
show_application: function() {
|
show_application: function () {
|
||||||
var res = this._super();
|
var res = this._super();
|
||||||
this.start_polling();
|
this.start_polling();
|
||||||
return res;
|
return res;
|
||||||
},
|
},
|
||||||
start_polling: function() {
|
start_polling: function () {
|
||||||
this.channel_success = "notify_success_" + session.uid;
|
this.channel_success = "notify_success_" + session.uid;
|
||||||
this.channel_danger = "notify_danger_" + session.uid;
|
this.channel_danger = "notify_danger_" + session.uid;
|
||||||
this.channel_warning = "notify_warning_" + session.uid;
|
this.channel_warning = "notify_warning_" + session.uid;
|
||||||
|
@ -35,9 +35,9 @@ odoo.define("web_notify.WebClient", function(require) {
|
||||||
}
|
}
|
||||||
this.call("bus_service", "on", "notification", this, this.bus_notification);
|
this.call("bus_service", "on", "notification", this, this.bus_notification);
|
||||||
},
|
},
|
||||||
bus_notification: function(notifications) {
|
bus_notification: function (notifications) {
|
||||||
var self = this;
|
var self = this;
|
||||||
_.each(notifications, function(notification) {
|
_.each(notifications, function (notification) {
|
||||||
var channel = notification[0];
|
var channel = notification[0];
|
||||||
var message = notification[1];
|
var message = notification[1];
|
||||||
if (
|
if (
|
||||||
|
@ -48,7 +48,7 @@ odoo.define("web_notify.WebClient", function(require) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
on_message: function(message) {
|
on_message: function (message) {
|
||||||
return this.call("notification", "notify", {
|
return this.call("notification", "notify", {
|
||||||
type: message.type,
|
type: message.type,
|
||||||
title: message.title,
|
title: message.title,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
odoo.define("web_notify.Notification", function(require) {
|
odoo.define("web_notify.Notification", function (require) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var Notification = require("web.Notification");
|
var Notification = require("web.Notification");
|
||||||
|
@ -11,7 +11,7 @@ odoo.define("web_notify.Notification", function(require) {
|
||||||
info: "fa-info",
|
info: "fa-info",
|
||||||
default: "fa-lightbulb-o",
|
default: "fa-lightbulb-o",
|
||||||
},
|
},
|
||||||
init: function() {
|
init: function () {
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
// Delete default classes
|
// Delete default classes
|
||||||
this.className = this.className.replace(" o_error", "");
|
this.className = this.className.replace(" o_error", "");
|
||||||
|
|
Loading…
Reference in New Issue