From ec8860448db6252ab833bc39604ff9b9c193f686 Mon Sep 17 00:00:00 2001 From: Benjamin Vray Date: Thu, 10 Dec 2020 10:15:43 +0000 Subject: [PATCH] [FIX] web_editor: fix color-customize dynamic svgs on snippet drop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit, the theme colors did not update dynamic svg images due to an inversion between key and value in the code. closes odoo/odoo#63154 X-original-commit: 9b1916c382f105d30e7d693c0b914c05db593da0 Signed-off-by: Jérémy Kersten (jke) --- addons/web_editor/static/src/js/editor/snippets.editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/editor/snippets.editor.js b/addons/web_editor/static/src/js/editor/snippets.editor.js index 58ec48fa416..050b4854604 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -2067,7 +2067,7 @@ var SnippetsMenu = Widget.extend({ // Color-customize dynamic SVGs in dropped snippets with current theme colors. [...$snippetToInsert.find('img[src^="/web_editor/shape/"]')].forEach(dynamicSvg => { const colorCustomizedURL = new URL(dynamicSvg.getAttribute('src'), window.location.origin); - colorCustomizedURL.searchParams.forEach((key, value) => { + colorCustomizedURL.searchParams.forEach((value, key) => { const match = key.match(/^c([1-5])$/); if (match) { colorCustomizedURL.searchParams.set(key, getCSSVariableValue(`o-color-${match[1]}`))