Skip to content

Commit

Permalink
[FIX] web_editor, mass_mailing: speed up opening of field html inline
Browse files Browse the repository at this point in the history
On opening field html with the inline styles option we were parsing all
the css in the page. This should only be needed when we save. This
commit moves the call to `getCSSRules`back to `commitChanges`.

closes #83074

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
  • Loading branch information
Zynton committed Jan 20, 2022
1 parent c884e82 commit 0d43423
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
4 changes: 0 additions & 4 deletions addons/mass_mailing/static/src/js/mass_mailing_widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ var MassMailingFieldHtml = FieldHtml.extend({
this.$content.find('.o_layout').addBack().data('name', 'Mailing');
// We don't want to drop snippets directly within the wysiwyg.
this.$content.removeClass('o_editable');
// Force compute CSS rules even without the style-inline node option.
if (this.mode === 'edit' && !this.cssRules) {
this.cssRules = convertInline.getCSSRules(this.wysiwyg.getEditable()[0].ownerDocument);
}
},
/**
* Returns true if the editable area is empty.
Expand Down
8 changes: 0 additions & 8 deletions addons/web_editor/static/src/js/backend/convert_inline.js
Original file line number Diff line number Diff line change
Expand Up @@ -955,14 +955,6 @@ FieldHtml.include({
// Public
//--------------------------------------------------------------------------

_createWysiwygIntance: function () {
return this._super(...arguments).then(() => {
if (this.nodeOptions['style-inline'] && this.mode === "edit") {
this.cssRules = getCSSRules(this.wysiwyg.getEditable()[0].ownerDocument);
}
});
},

/**
* @override
*/
Expand Down

0 comments on commit 0d43423

Please sign in to comment.