summaryrefslogtreecommitdiff
path: root/addons/mass_mailing/views/editor_field_html.xml
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@odoo.com>2019-01-28 09:39:56 +0000
committerChristophe Matthieu <chm@odoo.com>2019-02-14 15:11:19 +0000
commitb49745e52d7a7bc27afd416206dcd5fa242aa07a (patch)
treeae6a047da7e77b951db241e1342278ce543972e2 /addons/mass_mailing/views/editor_field_html.xml
parent7daa85dd12ff522be510bc2f8db1d968cae7d891 (diff)
[IMP] web_editor: lazy load the wysiwyg
Issue: wysiwyg asset slow down the loading of the website, error inadvertently introduced: https://github.com/odoo/odoo/pull/29775 The assets are now loaded assynchroneously, when the editor is needed, its assets will be loaded. closes odoo/odoo#30700
Diffstat (limited to 'addons/mass_mailing/views/editor_field_html.xml')
-rw-r--r--addons/mass_mailing/views/editor_field_html.xml16
1 files changed, 13 insertions, 3 deletions
diff --git a/addons/mass_mailing/views/editor_field_html.xml b/addons/mass_mailing/views/editor_field_html.xml
index 25f2be6fe23..620ccc78c44 100644
--- a/addons/mass_mailing/views/editor_field_html.xml
+++ b/addons/mass_mailing/views/editor_field_html.xml
@@ -7,15 +7,17 @@
</template>
<template id="assets_mail_themes_edition"> <!-- maybe to remove and convert into a field dumy with attr invisible if the template is not selected -->
- <t t-call="web._assets_helpers"/>
- <link rel="stylesheet" type="text/scss" href="/web/static/src/scss/webclient.scss"/>
- <link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/wysiwyg_variables.scss"/>
+ <t t-call="web._assets_helpers">
+ <link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/wysiwyg_variables.scss"/>
+ </t>
<link rel="stylesheet" type="text/scss" href="/mass_mailing/static/src/scss/mass_mailing.ui.scss"/>
+ <link rel="stylesheet" type="text/scss" href="/web/static/src/scss/webclient.scss"/>
</template>
<template id="iframe_css_assets_edit">
<t t-call-assets="web.assets_common" t-js="false"/>
<t t-call-assets="web.assets_frontend" t-js="false"/>
+ <t t-call-assets="web_editor.assets_wysiwyg" t-js="false"/>
<t t-call-assets="mass_mailing.assets_mail_themes" t-js="false"/>
<t t-call-assets="mass_mailing.assets_mail_themes_edition" t-js="false"/>
</template>
@@ -26,6 +28,14 @@
<template id="qunit_suite" inherit_id="web.qunit_suite">
<xpath expr="." position="inside">
+ <script type="text/javascript">
+ odoo.define('mass_mailing.FieldHtml.test', function (require) {
+ 'use strict';
+ var MassMailingFieldHtml = require('mass_mailing.FieldHtml');
+ MassMailingFieldHtml.include({jsLibs: []});
+ });
+ </script>
+ <script type="text/javascript" src="/mass_mailing/static/src/js/mass_mailing_snippets.js"/>
<script type="text/javascript" src="/mass_mailing/static/tests/mass_mailing_html_tests.js"/>
</xpath>
</template>