summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js
diff options
context:
space:
mode:
authorYounn Olivier <yol@odoo.com>2021-03-29 15:08:01 +0000
committerqsm-odoo <qsm@odoo.com>2021-04-06 09:53:07 +0000
commitd6c1d1572eafc2586974f2c5b98abe2b341b38a7 (patch)
treeb2ed2963cb81773ae5099c5d432b895db87ac88b /addons/web_editor/static/src/js
parentf79553387ec7e769c703377c4be0026413468f46 (diff)
[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) <qsm@odoo.com>
Diffstat (limited to 'addons/web_editor/static/src/js')
-rw-r--r--addons/web_editor/static/src/js/editor/rte.js4
1 files changed, 4 insertions, 0 deletions
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