From 634f6ae4d4208f0551bc2b81c359915eb47316b5 Mon Sep 17 00:00:00 2001
From: shsa-odoo <shsa@odoo.com>
Date: Mon, 26 Sep 2022 09:04:23 +0000
Subject: [PATCH] [FIX] mass_mailing: should not crash when loading snippets

Current behavior before fix:

In mobile view when we click invite button on events module which loads the
snippet, at that time there was a traceback.

Desired behavior after fix:

Now the snippet gets loaded without any traceback.

Task-2994261

closes odoo/odoo#101238

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
---
 addons/mass_mailing/static/src/js/mass_mailing_html_field.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/addons/mass_mailing/static/src/js/mass_mailing_html_field.js b/addons/mass_mailing/static/src/js/mass_mailing_html_field.js
index 49015f1d3e92..6f4a4e602946 100644
--- a/addons/mass_mailing/static/src/js/mass_mailing_html_field.js
+++ b/addons/mass_mailing/static/src/js/mass_mailing_html_field.js
@@ -210,7 +210,7 @@ export class MassMailingHtmlField extends HtmlField {
 
         if (device.isMobile) {
             $snippetsSideBar.hide();
-            this.$content.attr('style', 'padding-left: 0px !important');
+            this.wysiwyg.$iframe.attr('style', 'padding-left: 0px !important');
         }
 
         if (!odoo.debug) {
-- 
GitLab