[FIX] mass_mailing: prevent use of unsupported image transform option

The image transform option uses the `transform` CSS property, which is
very poorly supported in email clients. This hides that option so as to
avoid bad surprises.

task-2802705

closes odoo/odoo#88052

X-original-commit: 611c9a2aa65f3c6f9e1c0780cb9177bc1e67513d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit is contained in:
Antoine Guenet
2022-04-07 13:23:51 +02:00
parent 02b8b4edff
commit ff422df492
@@ -197,6 +197,23 @@ options.registry.BackgroundImage = options.registry.BackgroundImage.extend({
options.registry.ImageTools.include({
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
/**
* @override
*/
async updateUIVisibility() {
await this._super(...arguments);
// Transform is _very_ badly supported in mail clients. Hide the option.
const transformEl = this.el.querySelector('[data-transform="true"]');
if (transformEl) {
transformEl.classList.toggle('d-none', true);
}
},
//--------------------------------------------------------------------------
// Private
//--------------------------------------------------------------------------