[FIX] web_editor: fix color-customize dynamic svgs on snippet drop

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) <jke@openerp.com>
This commit is contained in:
Benjamin Vray
2020-12-10 12:06:37 +00:00
parent de3bc12c00
commit ec8860448d
@@ -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]}`))