Browse Source

[FIX] Fixed inheritance bugs in web_notify. Did caused problems when used with other modules which do inherit from WebClient (web_auto_refresh)

pull/1046/head
Wolfgang Pichler 6 years ago
parent
commit
9a4b74aef8
  1. 1
      web_notify/README.rst
  2. 21
      web_notify/static/src/js/web_client.js

1
web_notify/README.rst

@ -93,6 +93,7 @@ Contributors
* Laurent Mignon <laurent.mignon@acsone.eu> * Laurent Mignon <laurent.mignon@acsone.eu>
* Serpent Consulting Services Pvt. Ltd.<jay.vora@serpentcs.com> * Serpent Consulting Services Pvt. Ltd.<jay.vora@serpentcs.com>
* Guewen Baconnier <guewen.baconnier@camptocamp.com> * Guewen Baconnier <guewen.baconnier@camptocamp.com>
* Wolfgang Pichler <wpichler@callino.at>
Maintainer Maintainer
---------- ----------

21
web_notify/static/src/js/web_client.js

@ -44,6 +44,9 @@ WebClient.include({
), ),
init: function(parent, client_options){ init: function(parent, client_options){
this._super(parent, client_options); this._super(parent, client_options);
this.channel_warning = 'notify_warning_' + this.session.uid;
this.channel_info = 'notify_info_' + this.session.uid;
}, },
reload_active_view: function(){ reload_active_view: function(){
var action_manager = this.action_manager; var action_manager = this.action_manager;
@ -57,23 +60,17 @@ WebClient.include({
}, },
show_application: function() { show_application: function() {
var res = this._super(); var res = this._super();
this.start_polling();
base_bus.bus.start_polling();
base_bus.bus.add_channel(this.channel_warning);
base_bus.bus.add_channel(this.channel_info);
base_bus.bus.on('notification', this, this._web_notify_notification);
return res return res
}, },
on_logout: function() { on_logout: function() {
var self = this;
base_bus.bus.off('notification', this, this.bus_notification);
base_bus.bus.off('notification', this, this._web_notify_notification);
this._super(); this._super();
}, },
start_polling: function() {
this.channel_warning = 'notify_warning_' + this.session.uid;
this.channel_info = 'notify_info_' + this.session.uid;
base_bus.bus.add_channel(this.channel_warning);
base_bus.bus.add_channel(this.channel_info);
base_bus.bus.on('notification', this, this.bus_notification);
base_bus.bus.start_polling();
},
bus_notification: function(notifications) {
_web_notify_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];

Loading…
Cancel
Save