[FIX] mail: correct chat window dropdown unread counter + hidden state

Revision on recent JS refactoring: https://github.com/odoo/odoo/commit/02ec09cb1c3e2d7bc7968f40c18f2208d7f3f498

Intermediary changes have not been updated with final way of communicating
with JS services. In particular, widgets must now explicitly call the
service with this.call instead of relying on a mixin that hides the service call
(e.g. the chat_mixin that has been removed)
This commit is contained in:
dbh
2018-02-20 13:33:01 +01:00
committed by Alexandre Kühn
parent f40abe400a
commit 7e4a8c03f1
2 changed files with 5 additions and 5 deletions
@@ -1634,7 +1634,7 @@ var ChatManager = AbstractService.extend({
web_client.set_title_part("_chat", tabTitle);
}
this._sendNotification(web_client, title, content);
this.call('bus_service', 'sendNotification', web_client, title, content);
},
/**
* Removes channel
@@ -387,8 +387,8 @@ var ChatWindowManager = AbstractService.extend({
this.displayState.hiddenSessions = hiddenSessions;
this.displayState.hiddenUnreadCounter = hiddenUnreadCounter;
if (this.displayState.$hidden_windows_dropdown) {
this.displayState.$hidden_windows_dropdown.remove();
if (this.displayState.$hiddenWindowsDropdown) {
this.displayState.$hiddenWindowsDropdown.remove();
}
if (hiddenSessions.length) {
this.displayState.$hiddenWindowsDropdown = this._renderHiddenSessionsDropdown();
@@ -487,8 +487,8 @@ var ChatWindowManager = AbstractService.extend({
self.displayState.hiddenUnreadCounter += session.window.unread_msgs;
}
});
if (self.displayState.$hidden_windows_dropdown) {
self.displayState.$hidden_windows_dropdown.html(self.renderHiddenSessionsDropdown().html());
if (self.displayState.$hiddenWindowsDropdown) {
self.displayState.$hiddenWindowsDropdown.html(self._renderHiddenSessionsDropdown().html());
self._repositionHiddenSessionsDropdown();
}
},