From d6c1d1572eafc2586974f2c5b98abe2b341b38a7 Mon Sep 17 00:00:00 2001 From: Younn Olivier Date: Mon, 29 Mar 2021 15:08:01 +0000 Subject: [FIX] website_sale, *: make the product image container not editable *: web_editor It prevents user writing in the image preview of products. Also, the product image view now fit its container so that the user can click wherever in the frame to change the picture. Part of https://github.com/odoo/odoo/pull/65575 task-2446852 closes odoo/odoo#65575 Signed-off-by: Quentin Smetz (qsm) --- addons/web_editor/static/src/js/editor/rte.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'addons/web_editor/static/src/js') diff --git a/addons/web_editor/static/src/js/editor/rte.js b/addons/web_editor/static/src/js/editor/rte.js index 6194cfd35b6..3dc7c69baab 100644 --- a/addons/web_editor/static/src/js/editor/rte.js +++ b/addons/web_editor/static/src/js/editor/rte.js @@ -565,6 +565,10 @@ var RTEWidget = Widget.extend({ if ($editable.is('[data-oe-model]') && !$editable.is('[data-oe-model="ir.ui.view"]') && !$editable.is('[data-oe-type="html"]')) { $editable.data('layoutInfo').popover().find('.btn-group:not(.note-history)').remove(); } + if ($editable.data('oe-type') === "image") { + $editable.attr('contenteditable', false); + $editable.find('img').attr('contenteditable', true); + } }, /** * When an element enters edition, summernote is initialized on it. This -- cgit v1.2.3