[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
This commit is contained in:
Antoine Guenet
2022-05-24 12:48:18 +02:00
parent 417fc95b72
commit 5bf043567e
@@ -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 = [