From 9822c42707cab575b4a173b60569da1a1c6725aa Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Mon, 13 Nov 2017 12:00:30 +0100 Subject: [PATCH] [FIX] mass_mailing: switch to theme images at 1st theme selection Without this patch, default images for themes are not used automatically in themes' templates when one is chosen for the 1st time. This was not inducing any bug in standard 10.0 but with custom-made templates, you had to put the correct themes images in the defined template. This allows to just `t-call` snippets instead of having to fully hardcode them in theme templates. --- addons/mass_mailing/static/src/js/mass_mailing_editor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/mass_mailing/static/src/js/mass_mailing_editor.js b/addons/mass_mailing/static/src/js/mass_mailing_editor.js index cc0b9d2dd08..9e62986b383 100644 --- a/addons/mass_mailing/static/src/js/mass_mailing_editor.js +++ b/addons/mass_mailing/static/src/js/mass_mailing_editor.js @@ -326,7 +326,6 @@ snippets_editor.Class.include({ switch_theme.last = theme_params; $body.removeClass(all_classes).addClass(theme_params.className); - switch_images(theme_params, $editable_area); var $old_layout = $editable_area.find(".o_layout"); // This wrapper structure is the only way to have a responsive and @@ -349,8 +348,9 @@ snippets_editor.Class.include({ $contents = $editable_area.contents(); } - $editable_area.empty().append($new_layout); $new_wrapper_content.append($contents); + switch_images(theme_params, $new_wrapper_content); + $editable_area.empty().append($new_layout); $old_layout.remove(); if (first_choice) {