From 5bf043567e5ec287022d4fa0ff15221e56668c62 Mon Sep 17 00:00:00 2001 From: Antoine Guenet Date: Mon, 11 Apr 2022 10:30:24 +0000 Subject: [PATCH] [FIX] mass_mailing: make sure #design-element is prepended to .o_layout When styling a theme in XML, we don't have access to the top of `.o_layout`, leading to the design element being located in different places depending on whether it's been added programmatically or in XML. This harmonizes it, ensuring it's always at the top of `.o_layout`. X-original-commit: ab61f1d38b2852ec0b6727122a1cfc2cd81cfc9f Part-of: odoo/odoo#92138 --- .../static/src/js/mass_mailing_design_constants.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/mass_mailing/static/src/js/mass_mailing_design_constants.js b/addons/mass_mailing/static/src/js/mass_mailing_design_constants.js index 1f9b9b70ca3..a5bcc187249 100644 --- a/addons/mass_mailing/static/src/js/mass_mailing_design_constants.js +++ b/addons/mass_mailing/static/src/js/mass_mailing_design_constants.js @@ -94,10 +94,10 @@ export const initializeDesignTabCss = $editable => { // If a style element can't be found, create one and initialize it. styleElement = document.createElement('style'); styleElement.setAttribute('id', 'design-element'); - // The style element needs to be within the layout of the email in - // order to be saved along with it. - $editable.find('.o_layout').prepend(styleElement); } + // The style element needs to be within the layout of the email in + // order to be saved along with it. + $editable.find('.o_layout').prepend(styleElement); }; export const FONT_FAMILIES = [