From 843507a35b64c5ba30967f9e20cd3acbfe0bba82 Mon Sep 17 00:00:00 2001 From: Benoit Socias Date: Mon, 23 Aug 2021 07:57:15 +0000 Subject: [PATCH] [FIX] web_editor: keep each style when editing link Before this commit editing a link that was saved with fill styles did reset it to a different value and even changed the 'type' to 'link'. After this commit re-editing the link works for each style. task-2629461 closes odoo/odoo#75512 X-original-commit: 4f6cc912260c5b5689b0e87644ad119ef5a1389c Signed-off-by: Quentin Smetz (qsm) Signed-off-by: Benoit Socias (bso) --- addons/web_editor/static/src/js/wysiwyg/widgets/link.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/wysiwyg/widgets/link.js b/addons/web_editor/static/src/js/wysiwyg/widgets/link.js index 0b257c0fe1a..442ff8ef74f 100644 --- a/addons/web_editor/static/src/js/wysiwyg/widgets/link.js +++ b/addons/web_editor/static/src/js/wysiwyg/widgets/link.js @@ -109,7 +109,7 @@ const Link = Widget.extend({ const subValues = value.split(','); let subActive = true; for (let subValue of subValues) { - const classPrefix = new RegExp('(^|btn-| |btn-outline-)' + subValue); + const classPrefix = new RegExp('(^|btn-| |btn-outline-|btn-fill-)' + subValue); subActive = subActive && classPrefix.test(this.data.iniClassName); } active = subActive;