[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
This commit is contained in:
Michael Mattiello (mcm)
2021-02-02 13:43:59 +00:00
parent 2c3ac6b254
commit b89e6245ec
@@ -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 {