summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js/thread.js
diff options
context:
space:
mode:
authorGéry Debongnie <ged@odoo.com>2015-11-06 10:05:25 +0100
committerGéry Debongnie <ged@odoo.com>2015-11-09 16:36:52 +0100
commit622bd038e4123f6006a2c6f9e44fc4bdfc436231 (patch)
tree60709a2e8b58c3a49396aee2969719e9644b6b76 /addons/mail/static/src/js/thread.js
parent2bb55ecb041ebdc1074cbf6e138ad24df1fe0581 (diff)
[FIX] mail: various ui improvements
- display star/mark as read icon next to the message title instead on the far right - display unstar all message in channel starred - enable/disable the 'unstar all' and 'mark read' buttons depending on the number of messages in the corresponding channels - display star on the left sidebar in 'squashed messages' - tweaks to padding in client action - display hash in channel name in lighter tone - light opacity in sidebar - star icon in message sidebar is clickable + small less refactoring - message sidebar is aligned with the message now - messages are not squashed in inbox/starred
Diffstat (limited to 'addons/mail/static/src/js/thread.js')
-rw-r--r--addons/mail/static/src/js/thread.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/addons/mail/static/src/js/thread.js b/addons/mail/static/src/js/thread.js
index 6667a635d65..60fa5fd63f5 100644
--- a/addons/mail/static/src/js/thread.js
+++ b/addons/mail/static/src/js/thread.js
@@ -46,6 +46,7 @@ var Thread = Widget.extend({
default_username: _t('Anonymous'),
display_document_link: true,
display_avatar: true,
+ squash_close_messages: true,
});
},
@@ -54,6 +55,7 @@ var Thread = Widget.extend({
if (this.options.display_order === ORDER.DESC) {
msgs.reverse();
}
+ options = _.extend({}, this.options, options);
// Hide avatar and info of a message if that message and the previous
// one are both comments wrote by the same author at the same minute
@@ -63,6 +65,8 @@ var Thread = Widget.extend({
prev_msg.message_type !== 'comment' || msg.message_type !== 'comment' ||
(prev_msg.author_id[0] !== msg.author_id[0])) {
msg.display_author = true;
+ } else {
+ msg.display_author = !options.squash_close_messages;
}
prev_msg = msg;
});
@@ -131,10 +135,12 @@ var Thread = Widget.extend({
*/
remove_message_and_render: function (message_id, messages, options) {
var self = this;
+ var done = $.Deferred();
this.$('.o_thread_message[data-message-id=' + message_id + ']').fadeOut({
- done: function () { self.render(messages, options); },
+ done: function () { self.render(messages, options); done.resolve();},
duration: 200,
});
+ return done;
},
/**