diff options
| author | Dharmang Soni <dpr@odoo.com> | 2017-04-26 10:51:15 +0530 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-09-15 15:25:06 +0200 |
| commit | 4685e4bc7f19f964697bf0dbd7dfdf254b6c5628 (patch) | |
| tree | b852d056ac124aa692dff20f468dd62add05b00e /addons/mail/static/src/js/chat_window.js | |
| parent | a8e7d096b85709ccf52411c450d0574f9238fd6f (diff) | |
[IMP] mail: improve Discuss UI for mobile devices
- Brand new UI for Discuss client action (with tabs for Inbox,
chats, channels...)
- In mobile, conversations always open in Chat Windows
- Chat window UI improved (both mobile and desktop)
- Channels preview (used in the systray menu, and now in the mobile
UI of Discuss) improved
- Other minor less tweaks
Diffstat (limited to 'addons/mail/static/src/js/chat_window.js')
| -rw-r--r-- | addons/mail/static/src/js/chat_window.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/addons/mail/static/src/js/chat_window.js b/addons/mail/static/src/js/chat_window.js index 9f91baee764..9d54a6df0b2 100644 --- a/addons/mail/static/src/js/chat_window.js +++ b/addons/mail/static/src/js/chat_window.js @@ -11,7 +11,7 @@ var QWeb = core.qweb; var _t = core._t; var HEIGHT_OPEN = '400px'; -var HEIGHT_FOLDED = '28px'; +var HEIGHT_FOLDED = '34px'; return Widget.extend({ template: "mail.ChatWindow", @@ -43,6 +43,7 @@ return Widget.extend({ this.status = this.options.status; this.unread_msgs = unread_msgs || 0; this.is_hidden = false; + this.isMobile = config.isMobile; }, start: function () { this.$input = this.$('.o_composer_text_field'); @@ -76,6 +77,13 @@ return Widget.extend({ this.unread_msgs = counter; this.render_header(); }, + + /** + * When user status (online/offline/away) changed, this method update + * user status with last seen and render header again. + * + * @param {string} status + */ update_status: function (status) { this.status = status; this.render_header(); @@ -84,13 +92,14 @@ return Widget.extend({ this.$header.html(QWeb.render('mail.ChatWindowHeaderContent', { status: this.status, title: this.title, + isMobile: this.isMobile, unread_counter: this.unread_msgs, })); }, fold: function () { this.$el.animate({ height: this.folded ? HEIGHT_FOLDED : HEIGHT_OPEN - }); + }, 200); }, toggle_fold: function (fold) { this.folded = _.isBoolean(fold) ? fold : !this.folded; |
