From 83f24391cd6f846bea8ecdb3e86442be55ed490f Mon Sep 17 00:00:00 2001 From: "Chrysanthe (chgo)" Date: Sat, 20 Apr 2024 08:00:33 +0000 Subject: [PATCH] [FIX] web_editor: fix user avatar aspect-ratio MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit fixes an issue occurring in the `web_editor` when multiple users edit some content. Prior to this commit, the user avatar was not using any aspect-ratio rule, resulting in a stretch avatar if the uploaded image wasn't square. This commit fixes this issue by adding the `o_object_fit_cover` class to the image, ensuring a correct ratio no matter the format of the uploaded image. task-3877841 closes odoo/odoo#162810 X-original-commit: 7240fa3ff495a8aba7bd53b720e99cd767948342 Signed-off-by: David Monjoie (dmo) Signed-off-by: Chrysanthe Gomrée (chgo) --- .../static/src/js/editor/odoo-editor/src/OdooEditor.js | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js b/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js index 46b68b60bda..84581ef0d94 100644 --- a/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js +++ b/addons/web_editor/static/src/js/editor/odoo-editor/src/OdooEditor.js @@ -1954,6 +1954,7 @@ export class OdooEditor extends EventTarget { avatarElement.append(image); image.onload = () => avatarElement.style.removeProperty('display'); image.setAttribute('src', clientAvatarUrl); + image.classList.add('o_object_fit_cover'); } // Avoid re-appending the element in the dom. if (!avatarElement.parentElement) {