From c616f38f773d9ca12f38f770ced07ed9dc99e724 Mon Sep 17 00:00:00 2001 From: Antoine Guenet Date: Mon, 3 Jan 2022 12:36:28 +0000 Subject: [PATCH] [FIX] web_editor: display current text color in text color button The editor toolbar button to trigger the colorpicker is supposed to show the color of the currently selected text. This was failing in iframes because the code was called on the wrong document. task-2623347 X-original-commit: 7ad6536dd98f9749d63bfc7292e490f6ac629b9c Part-of: odoo/odoo#83254 --- addons/web_editor/static/lib/odoo-editor/src/OdooEditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/lib/odoo-editor/src/OdooEditor.js b/addons/web_editor/static/lib/odoo-editor/src/OdooEditor.js index 9e6835f09e4..f82c9396874 100644 --- a/addons/web_editor/static/lib/odoo-editor/src/OdooEditor.js +++ b/addons/web_editor/static/lib/odoo-editor/src/OdooEditor.js @@ -1390,7 +1390,7 @@ export class OdooEditor extends EventTarget { if (hasGradient && hasTextGradientClass) { foreColor = backgroundImage; } else { - foreColor = document.queryCommandValue('foreColor'); + foreColor = this.document.queryCommandValue('foreColor'); } } if (!hiliteColor) {