From 169f819ab147f2335f05210513279282cceb70ee Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Mon, 7 Dec 2015 13:57:48 +0100 Subject: [PATCH] [FIX] mail: read more: prevent default Long messages are not displayed entirely, but a 'read more' button is displayed and allows to show the whole message. This button is an inside a , both having classname 'oe_mail_expand'. Also note that messages are html, not plain text. Sometimes, the long message is truncated at some point that the 'read more' is inserted inside an , which is not html valid (nested links). In this case, the browser automatically moves the inner out of the outer one. Unfortunately, when that happens, clicking on 'read more' redirects to the app switcher because of missing prevent_default(), as the event handler was bound on the clicked, not the inner . This rev. simply binds the handler on 'oe_mail_expand', not specifically on its . --- addons/mail/static/src/js/thread.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mail/static/src/js/thread.js b/addons/mail/static/src/js/thread.js index 840563cdc85..e7198745779 100644 --- a/addons/mail/static/src/js/thread.js +++ b/addons/mail/static/src/js/thread.js @@ -34,7 +34,7 @@ var Thread = Widget.extend({ this.$('.o_thread_message').removeClass('o_thread_selected_message'); $(event.currentTarget).toggleClass('o_thread_selected_message', !selected); }, - "click span.oe_mail_expand": function (event) { + "click .oe_mail_expand": function (event) { event.preventDefault(); var $source = $(event.currentTarget); $source.parents('.o_thread_message_core').find('.o_mail_body_short').toggle();