From b058f7094191364083fbd50b18cafabf5fa82b4a Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Tue, 20 Aug 2019 13:39:39 +0000 Subject: [PATCH] [FIX] web_editor: font>a colorize a change font color If you change the color of a link with the editor without using the link edition menu, this do not work (which might be expected), but if the text outside the font had been colorized, the font will be applied outside of the link only. This is unexpected since if we have: "hello cruel world!", if we select only "cruel" and change color, the change only happen to "hello" and "world!". With this changeset, an anchor in the ancestor prevent to use an ancestor font tag to change color (which prevent the issue). opw-2044551 closes #35862 Signed-off-by: Nicolas Lempereur (nle) --- addons/web_editor/static/src/js/summernote.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/web_editor/static/src/js/summernote.js b/addons/web_editor/static/src/js/summernote.js index e52ea66614d..0f6c7cddd03 100644 --- a/addons/web_editor/static/src/js/summernote.js +++ b/addons/web_editor/static/src/js/summernote.js @@ -2121,13 +2121,15 @@ $.summernote.pluginEvents.applyFont = function (event, editor, layoutInfo, color } // apply font: foreColor, backColor, size (the color can be use a class text-... or bg-...) - var node, font, $font, fonts = [], className; + var node, ancestors, font, $font, fonts = [], className; if (color || bgcolor || size) { for (var i=0; i