diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-11-10 14:15:02 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-11-10 14:15:02 +0100 |
| commit | ebb6d1e7402e7360f84730a400983d513e0d8607 (patch) | |
| tree | a135d3b130f4dadbf721b8bbbc31c14c8d0b93f2 /addons/web_editor | |
| parent | d86da5de53ab8ffc089b7d86a920e536bd65dff9 (diff) | |
| parent | 350973ff36619bec129a3dace312ec0ae561c55e (diff) | |
[MERGE] forward port branch 11.0 up to 350973ff366
Diffstat (limited to 'addons/web_editor')
| -rw-r--r-- | addons/web_editor/static/src/js/editor/snippets.editor.js | 2 | ||||
| -rw-r--r-- | addons/web_editor/static/src/js/editor/snippets.options.js | 4 | ||||
| -rw-r--r-- | addons/web_editor/views/editor.xml | 8 |
3 files changed, 9 insertions, 5 deletions
diff --git a/addons/web_editor/static/src/js/editor/snippets.editor.js b/addons/web_editor/static/src/js/editor/snippets.editor.js index 2f457019ae3..1c208956624 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -227,7 +227,7 @@ var SnippetEditor = Widget.extend({ var optionName = val.option; var $el = val.$el.children('li').clone(true).addClass('snippet-option-' + optionName); - var option = new (options.registry[optionName] || options.Class)(self, self.$target, self.$el); + var option = new (options.registry[optionName] || options.Class)(self, self.$target, self.$el, val.data); self.styles[optionName || _.uniqueId('option')] = option; option.__order = i++; return option.attachTo($el); diff --git a/addons/web_editor/static/src/js/editor/snippets.options.js b/addons/web_editor/static/src/js/editor/snippets.options.js index 08694882603..e1f69e0f889 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -37,10 +37,11 @@ var SnippetOption = Widget.extend({ * * @constructor */ - init: function (parent, $target, $overlay) { + init: function (parent, $target, $overlay, data) { this._super.apply(this, arguments); this.$target = $target; this.$overlay = $overlay; + this.data = data; this.__methodNames = []; }, /** @@ -50,7 +51,6 @@ var SnippetOption = Widget.extend({ * @override */ start: function () { - this.data = this.$el.data(); this._setActive(); return this._super.apply(this, arguments); }, diff --git a/addons/web_editor/views/editor.xml b/addons/web_editor/views/editor.xml index 8b7b51944a5..4bfe84887d0 100644 --- a/addons/web_editor/views/editor.xml +++ b/addons/web_editor/views/editor.xml @@ -114,10 +114,14 @@ <t t-call-assets="web_editor.assets_editor" t-css="false"/> </xpath> </template> -<template id="qunit_suite" inherit_id="web.qunit_suite"> - <xpath expr="//t[@t-call-assets='web.assets_backend'][@t-css='false']" position="after"> +<template id="js_tests_assets" inherit_id="web.js_tests_assets"> + <xpath expr="." position="inside"> <t t-call-assets="web_editor.summernote" t-css="false"/> <t t-call-assets="web_editor.assets_editor" t-css="false"/> + </xpath> +</template> +<template id="qunit_suite" inherit_id="web.qunit_suite"> + <xpath expr="." position="inside"> <script type="text/javascript" src="/web_editor/static/tests/web_editor_tests.js"></script> </xpath> </template> |
