diff options
| author | qsm-odoo <qsm@odoo.com> | 2020-10-16 09:54:19 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2020-10-19 14:57:28 +0000 |
| commit | 1a916fc2362c0b006460d94a219366ade1cce058 (patch) | |
| tree | c6e31877688868752b7d4c8bac4eef3c30eba46b /addons/web_editor/static/src/js | |
| parent | 22a9a3de3c205709597ab95d8987466bd5579c86 (diff) | |
[FIX] mass_mailing, *: restore mass mailing options
*: web_editor
The snippet options which were specific to mass mailing were not loaded
anymore as they were loaded outside of the iframe where the edition
take places. Fortunately, the generic options were still working and
are the most important.
This bug was only revealed thanks to another bug fix which wanted to
be done in the unloaded file.
Note: this fix is a series of huge hack to make it possible and as safe
as possible in stable versions. This obviously has to be refactored in
master, if not already done.
Part of https://github.com/odoo/odoo/pull/60203
X-original-commit: 7225ce6b862c4f6b99a97732833b43189530699a
Diffstat (limited to 'addons/web_editor/static/src/js')
| -rw-r--r-- | addons/web_editor/static/src/js/backend/field_html.js | 1 | ||||
| -rw-r--r-- | addons/web_editor/static/src/js/wysiwyg/root.js | 3 | ||||
| -rw-r--r-- | addons/web_editor/static/src/js/wysiwyg/wysiwyg_iframe.js | 3 |
3 files changed, 6 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/backend/field_html.js b/addons/web_editor/static/src/js/backend/field_html.js index 7005318ef28..8c7a4eb7264 100644 --- a/addons/web_editor/static/src/js/backend/field_html.js +++ b/addons/web_editor/static/src/js/backend/field_html.js @@ -173,6 +173,7 @@ var FieldHtml = basic_fields.DebouncedField.extend(TranslatableFieldMixin, { _createWysiwygIntance: function () { var self = this; this.wysiwyg = new Wysiwyg(this, this._getWysiwygOptions()); + this.wysiwyg.__extraAssetsForIframe = this.__extraAssetsForIframe || []; // by default this is synchronous because the assets are already loaded in willStart // but it can be async in the case of options such as iframe, snippets... diff --git a/addons/web_editor/static/src/js/wysiwyg/root.js b/addons/web_editor/static/src/js/wysiwyg/root.js index dc87ff9e0be..57e9f65e527 100644 --- a/addons/web_editor/static/src/js/wysiwyg/root.js +++ b/addons/web_editor/static/src/js/wysiwyg/root.js @@ -44,6 +44,9 @@ var WysiwygRoot = Widget.extend({ var Wysiwyg = self._getWysiwygContructor(); var instance = new Wysiwyg(self, self._params); + if (self.__extraAssetsForIframe) { + instance.__extraAssetsForIframe = self.__extraAssetsForIframe; + } self._params = null; _.each(self.publicMethods, function (methodName) { diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg_iframe.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg_iframe.js index 9450e96df93..f56f5b26553 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg_iframe.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg_iframe.js @@ -26,6 +26,7 @@ Wysiwyg.include({ if (this.options.inIframe) { this._onUpdateIframeId = 'onLoad_' + this.id; } + this.__extraAssetsForIframe = []; }, /** * Load assets to inject into iframe. @@ -112,7 +113,7 @@ Wysiwyg.include({ } var iframeContent = qweb.render('wysiwyg.iframeContent', { - assets: assets, + assets: assets.concat(self.__extraAssetsForIframe), updateIframeId: self._onUpdateIframeId, avoidDoubleLoad: _avoidDoubleLoad }); |
