diff options
| author | Martin Trigaux <mat@odoo.com> | 2015-12-21 11:37:53 +0100 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2015-12-21 11:37:53 +0100 |
| commit | e4bf03aeaf2c8200164c27f0d93994e2c173bded (patch) | |
| tree | abce75b917f931d042dba1e34060efd625f90ed7 /addons/mail/static/src/js/thread.js | |
| parent | 82a495eed52a9f42e5b88caa52c20a85f8d81ce3 (diff) | |
| parent | c298cf3250fcfa351775dc57c3b913169e30e418 (diff) | |
[MERGE] Forward port of branch saas-7 up to c298cf3
Diffstat (limited to 'addons/mail/static/src/js/thread.js')
| -rw-r--r-- | addons/mail/static/src/js/thread.js | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/addons/mail/static/src/js/thread.js b/addons/mail/static/src/js/thread.js index 86b34255cf7..99b4d6ba1c2 100644 --- a/addons/mail/static/src/js/thread.js +++ b/addons/mail/static/src/js/thread.js @@ -16,8 +16,9 @@ var Thread = Widget.extend({ className: 'o_mail_thread', events: { - "click .o_mail_redirect": "on_click_redirect", - "click .o_channel_redirect": "on_channel_redirect", + "click a": "on_click_redirect", + "click img": "on_click_redirect", + "click strong": "on_click_redirect", "click .o_thread_show_more": "on_click_show_more", "click .o_thread_message_needaction": function (event) { event.stopPropagation(); @@ -51,6 +52,7 @@ var Thread = Widget.extend({ display_stars: true, display_document_link: true, display_avatar: true, + shorten_messages: true, squash_close_messages: true, }); }, @@ -84,16 +86,13 @@ var Thread = Widget.extend({ }, on_click_redirect: function (event) { - event.preventDefault(); - var res_id = $(event.target).data('oe-id'); - var res_model = $(event.target).data('oe-model'); - this._redirect({model:res_model, id: res_id}); - }, - - on_channel_redirect: function (event) { - event.preventDefault(); - var channel_id = $(event.target).data('oe-id'); - this._redirect({channel_id: channel_id}); + var id = $(event.target).data('oe-id'); + if (id) { + event.preventDefault(); + var model = $(event.target).data('oe-model'); + var options = model && (model !== 'mail.channel') ? {model: model, id: id} : {channel_id: id}; + this._redirect(options); + } }, _redirect: _.debounce(function (options) { |
