diff options
| author | Aaron Bohy <aab@odoo.com> | 2016-02-05 10:50:41 +0100 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2016-02-08 08:29:53 +0100 |
| commit | 5ba53f3b11ef8cf0c7e6bbdd655ff35d5ffde0ad (patch) | |
| tree | 56d594250ce35dd6b22298a74fc7f3b5267177a1 /addons/mail/static/src/js/chat_window.js | |
| parent | 79a8eeb17d16a12ea7ce8fa946dd610c32035bd0 (diff) | |
[FIX] mail: display user status in chat windows
Diffstat (limited to 'addons/mail/static/src/js/chat_window.js')
| -rw-r--r-- | addons/mail/static/src/js/chat_window.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/addons/mail/static/src/js/chat_window.js b/addons/mail/static/src/js/chat_window.js index 1a9c0fa93ea..e7d3f061b68 100644 --- a/addons/mail/static/src/js/chat_window.js +++ b/addons/mail/static/src/js/chat_window.js @@ -7,6 +7,7 @@ var config = require('web.config'); var core = require('web.core'); var Widget = require('web.Widget'); +var QWeb = core.qweb; var _t = core._t; var HEIGHT_OPEN = '400px'; @@ -33,11 +34,13 @@ return Widget.extend({ placeholder: _t("Say something"), input_less: false, }); + this.status = this.options.status; this.unread_msgs = unread_msgs || 0; this.is_hidden = false; }, start: function () { this.$input = this.$('.o_chat_input input'); + this.$header = this.$('.o_chat_header'); this.thread = new ChatThread(this, { channel_id: this.channel_id, @@ -62,7 +65,18 @@ return Widget.extend({ }, update_unread: function (counter) { this.unread_msgs = counter; - this.$('.o_unread_counter').text(counter > 0 ? '(' + counter + ')' : ''); + this.render_header(); + }, + update_status: function (status) { + this.status = status; + this.render_header(); + }, + render_header: function () { + this.$header.html(QWeb.render('mail.ChatWindowHeaderContent', { + status: this.status, + title: this.title, + unread_counter: this.unread_msgs, + })); }, fold: function () { this.$el.animate({ |
