[IMP] web_editor: disable checklist and stars for readonly

Disable checklist and stars when the html field attribute readonly is
true.

task-2832281

closes odoo/odoo#89845

X-original-commit: 7c87495d34713cf4ea82cfeb376097d67862eb2a
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit is contained in:
Nicolas Bayet
2022-04-27 15:31:40 +02:00
parent 5951960bcf
commit ca5ddbbcd7
@@ -396,8 +396,10 @@ var FieldHtml = basic_fields.DebouncedField.extend(TranslatableFieldMixin, {
}
def.then(function () {
self.$content.on('click', 'ul.o_checklist > li', self._onReadonlyClickChecklist.bind(self));
self.$content.on('click', '.o_stars .fa-star, .o_stars .fa-star-o', self._onReadonlyClickStar.bind(self));
if (!self.hasReadonlyModifier) {
self.$content.on('click', 'ul.o_checklist > li', self._onReadonlyClickChecklist.bind(self));
self.$content.on('click', '.o_stars .fa-star, .o_stars .fa-star-o', self._onReadonlyClickStar.bind(self));
}
if (self.$iframe) {
// Iframe is hidden until fully loaded to avoid glitches.
self.$iframe.removeClass('d-none');