[FIX] web_editor, mass_mailing: speed up opening of field html inline
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 odoo/odoo#83131 X-original-commit: 0d4342317d456ed37f0bf24f00538ef54f847e60 Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user