Skip to content
Snippets Groups Projects
Commit 169f819a authored by Aaron Bohy's avatar Aaron Bohy
Browse files

[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 <a> inside a <span>,
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 <a>, which is not html valid (nested links). In this case,
the browser automatically moves the inner <a> 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 <span> clicked, not the inner <a>.

This rev. simply binds the handler on 'oe_mail_expand', not specifically on
its <span>.
parent 88c5a906
No related branches found
No related tags found
No related merge requests found
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment