diff options
| author | Aaron Bohy <aab@odoo.com> | 2015-10-01 10:10:21 +0200 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2015-10-01 14:00:20 +0200 |
| commit | 0e2dd225f6d62e705ceedc10bb8a3017c9c661a6 (patch) | |
| tree | 3eea3faf32f286d89d155f50dbba19d5b65c89d6 /addons | |
| parent | 673f4aa4a77161dc58e0e1bf97e8f713b1e88491 (diff) | |
[IMP] mail: client_action: sidebar items fine tuning
Mostly, display in bold channels with unread messages
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/mail/static/src/js/client_action.js | 7 | ||||
| -rw-r--r-- | addons/mail/static/src/less/client_action.less | 10 |
2 files changed, 13 insertions, 4 deletions
diff --git a/addons/mail/static/src/js/client_action.js b/addons/mail/static/src/js/client_action.js index ca880978ee4..1239492c38b 100644 --- a/addons/mail/static/src/js/client_action.js +++ b/addons/mail/static/src/js/client_action.js @@ -306,6 +306,7 @@ var ChatAction = Widget.extend(ControlPanelMixin, { this.$('.o_mail_chat_channel_item') .removeClass('o_active') .filter('[data-channel-id=' + channel_id + ']') + .removeClass('o_unread_message') .addClass('o_active'); this.$('.o_chat_composer').toggle(channel.type !== 'static'); @@ -401,6 +402,12 @@ var ChatAction = Widget.extend(ControlPanelMixin, { self.thread.scroll_to({id: message.id}); }); } + // Indicate in the sidebar that there is a new message in the corresponding channels + _.each(_.without(message.channel_ids, this.channel_id), function (channel_id) { + self.$('.o_mail_chat_channel_item') + .filter('[data-channel-id=' + channel_id + ']') + .addClass('o_unread_message'); + }); // Dump scroll position of channels in which the new message arrived this.channels_scrolltop = _.omit(this.channels_scrolltop, message.channel_ids); }, diff --git a/addons/mail/static/src/less/client_action.less b/addons/mail/static/src/less/client_action.less index ddb074f6923..53392488146 100644 --- a/addons/mail/static/src/less/client_action.less +++ b/addons/mail/static/src/less/client_action.less @@ -33,19 +33,21 @@ .o_mail_chat_channel_item { width: 100%; .o-webclient-padding(@top: 5px, @bottom: 5px); - padding-left: 2*@odoo-horizontal-padding; // larger padding than titles + padding-left: 1.5*@odoo-horizontal-padding; // larger padding than titles > .badge { margin: 0; } .o_mail_partner_unpin { - padding: 8px; - padding-top: 2px; + padding: 2px 8px; + } + &.o_unread_message { + font-weight: bold; } } .o_mail_add_channel { width: 100%; .o-webclient-padding(@top: 5px, @bottom: 5px); - padding-left: 2*@odoo-horizontal-padding; // larger padding than titles + padding-left: 1.5*@odoo-horizontal-padding; // larger padding than titles span { margin-right: 5px; } |
