diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-01-08 11:52:15 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-01-08 11:52:15 +0100 |
| commit | b50883d17b6d10acd3ef776b1ef6bb857b442236 (patch) | |
| tree | 7966306506d1d75fec9d8c90e5c313f9f1a3aca1 /addons/web_editor/static/src/js/editor/transcoder.js | |
| parent | 27a084eb814acd81679db1e461c53389d6afc875 (diff) | |
| parent | c07b7200b26d5bcac032338ee2912bc96e4d2195 (diff) | |
[MERGE] forward port branch 11.0 up to c07b7200b26
Diffstat (limited to 'addons/web_editor/static/src/js/editor/transcoder.js')
| -rw-r--r-- | addons/web_editor/static/src/js/editor/transcoder.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/addons/web_editor/static/src/js/editor/transcoder.js b/addons/web_editor/static/src/js/editor/transcoder.js index 30d1b73cc30..19c9c7d14c2 100644 --- a/addons/web_editor/static/src/js/editor/transcoder.js +++ b/addons/web_editor/static/src/js/editor/transcoder.js @@ -252,6 +252,9 @@ function applyOverDescendants(node, func) { if (node.nodeName === 'A' && $node.hasClass('btn') && !$node.children().length && $(node).parents('.o_outlook_hack').length) { node = $(node).parents('.o_outlook_hack')[0]; } + else if (node.nodeName === 'IMG' && $node.parent('p').hasClass('o_outlook_hack')) { + node = $node.parent()[0]; + } node = node.nextSibling; } } @@ -308,6 +311,9 @@ function classToStyle($editable) { $(node).remove(); } } + else if (node.nodeName === 'IMG' && $target.hasClass('center-block')) { + $target.wrap('<p class="o_outlook_hack" style="text-align:center;margin:0"/>'); + } }); } @@ -319,8 +325,8 @@ function classToStyle($editable) { */ function styleToClass($editable) { // Outlook revert - $editable.find('table.o_outlook_hack').each(function () { - $(this).after($('a', this)); + $editable.find('.o_outlook_hack').each(function () { + $(this).after($('a,img', this)); }).remove(); getMatchedCSSRules($editable[0]); |
