From b89e6245ecf96db3ea96fd4a62455311396eba33 Mon Sep 17 00:00:00 2001 From: "Michael Mattiello (mcm)" Date: Wed, 27 Jan 2021 10:04:36 +0000 Subject: [PATCH] [IMP] web_editor: make field html quick editable This commit makes the field html quick editable. We can click on a field html to switch the form view to edit mode but if we click on a link in the field, the link will have the priority. task 2330101 --- addons/web_editor/static/src/js/backend/field_html.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addons/web_editor/static/src/js/backend/field_html.js b/addons/web_editor/static/src/js/backend/field_html.js index 94b0a469237..999766d44e0 100644 --- a/addons/web_editor/static/src/js/backend/field_html.js +++ b/addons/web_editor/static/src/js/backend/field_html.js @@ -34,6 +34,7 @@ var FieldHtml = basic_fields.DebouncedField.extend(TranslatableFieldMixin, { description: _lt("Html"), className: 'oe_form_field oe_form_field_html', supportedFieldTypes: ['html'], + isQuickEditable: true, custom_events: { wysiwyg_focus: '_onWysiwygFocus', @@ -352,6 +353,12 @@ var FieldHtml = basic_fields.DebouncedField.extend(TranslatableFieldMixin, { var height = cwindow.document.body.scrollHeight; self.$iframe.css('height', Math.max(30, Math.min(height, 500)) + 'px'); + + $(cwindow).on('click', function (ev) { + if (!ev.target.closest("[href]")) { + self._onClick(ev); + } + }); }); }); } else {