From c365ed39255ef1f3aff47bdc7fa77277418a79e7 Mon Sep 17 00:00:00 2001 From: Ipsita Borisagar Date: Mon, 18 Jul 2022 10:01:58 +0000 Subject: [PATCH] [FIX] mass_mailing: should not land on top Before this commit: When the page is expanded and try to add any block with an image, try to change the image using replace button. It lands the user at the top of the page instead of staying image place. After this commit: The user will stay at the image place after clicking on replace button. Task-2753302 closes odoo/odoo#97266 X-original-commit: da4fdd90622b1f6ba2e45e717fcb4fdde09033af Signed-off-by: David Monjoie (dmo) --- .../static/src/js/mailing_mailing_view_form_full_width.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/mass_mailing/static/src/js/mailing_mailing_view_form_full_width.js b/addons/mass_mailing/static/src/js/mailing_mailing_view_form_full_width.js index bfbb55e8ddf..e9c98b8d570 100644 --- a/addons/mass_mailing/static/src/js/mailing_mailing_view_form_full_width.js +++ b/addons/mass_mailing/static/src/js/mailing_mailing_view_form_full_width.js @@ -108,7 +108,11 @@ const MassMailingFullWidthFormController = FormController.extend({ } else { const ref = $iframeDoc.find('#iframe_target')[0]; if (ref) { - this.$iframe.height(Math.max(ref.scrollHeight + VERTICAL_OFFSET, minHeight)); + this.$iframe.css({ + height: this._isFullScreen() + ? $(window).height() + : Math.max(ref.scrollHeight + VERTICAL_OFFSET, minHeight), + }); } } }, @@ -126,7 +130,6 @@ const MassMailingFullWidthFormController = FormController.extend({ const isFullscreen = this._isFullScreen(); if (isFullscreen) { $sidebar.height(windowHeight); - this.$iframe.height(windowHeight); $sidebar.css({ top: '', bottom: '',