Skip to content
Snippets Groups Projects
Commit 8002da27 authored by Adrien Dieudonne's avatar Adrien Dieudonne
Browse files

[FIX] mail: multiple read more - better heuristic

- wildcard selector for stopSpelling
- <br> tags must not split read more/read less
parent 44fd6a55
No related branches found
No related tags found
No related merge requests found
......@@ -147,7 +147,7 @@ var Thread = Widget.extend({
var $child = $(child);
// Hide Text nodes if "stopSpelling"
if (child.nodeType === 3 && $child.prevAll("#stopSpelling").length > 0) {
if (child.nodeType === 3 && $child.prevAll("[id*='stopSpelling']").length > 0) {
// Convert Text nodes to Element nodes
var $child = $('<span>', {
text: child.textContent,
......@@ -157,7 +157,7 @@ var Thread = Widget.extend({
}
// Create array for each "read more" with nodes to toggle
if ($child.attr('data-o-mail-quote')) {
if ($child.attr('data-o-mail-quote') || ($child.get(0).nodeName === 'BR' && $child.prev("[data-o-mail-quote='1']").length > 0)) {
if (!read_more_nodes) {
read_more_nodes = [];
groups.push(read_more_nodes);
......
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