diff options
| author | Géry Debongnie <ged@odoo.com> | 2015-12-09 14:41:16 +0100 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2015-12-11 14:04:59 +0100 |
| commit | a53bd875857f60a80c262ed8a648d3c5295e2751 (patch) | |
| tree | 0f1e6f636df151152444cb2f24f6e6e90049c00c /addons/mail/static/src/js/thread.js | |
| parent | 5cf29dcff2280b3439b82d6844d57c5c73bed34a (diff) | |
[FIX] mail: various UI improvements to chat interface
- don't display user name in chat windows
- scroll to the new messages separator if it exists (in client action)
- increase sidebar width
- add correct link href in threads
- hide chat window in mobile mode
- mail: ignore o_mail_redirect or o_channel_redirect, but redirect anyway
Diffstat (limited to 'addons/mail/static/src/js/thread.js')
| -rw-r--r-- | addons/mail/static/src/js/thread.js | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/addons/mail/static/src/js/thread.js b/addons/mail/static/src/js/thread.js index 5381c9f89c3..b35445e8d3f 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(); @@ -85,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: model, id: id} : {channel_id: id}; + this._redirect(options); + } }, _redirect: _.debounce(function (options) { |
