diff options
| author | qsm-odoo <qsm@odoo.com> | 2017-11-08 17:27:24 +0100 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2017-11-08 18:28:48 +0100 |
| commit | c7171795f891335e8a8b6d5a6b796c28cea77fea (patch) | |
| tree | 2246ffd016c58527b16da0dc275d283fb03d01cd /addons/web_editor | |
| parent | 191f9d05984a02bda5717ccd9256d44e130cfd35 (diff) | |
[FIX] web_editor: restore snippet option data parameter
Snippet options were not receiving proper data parameter on
instantiantion due to a websitepocalypse wrong adaptation. Those
data are parameters to tweak an option behavior, directly defined
on the option's <div/> in the XML. By mistake, they were now taken
on the child <li/> element (main DOM element of the option).
A visual example of the bug is the overlay colorpicker displaying
"Background Color" as a title instead of "Overlay Color".
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 |
2 files changed, 3 insertions, 3 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 d192ad00d7d..5f721fd4805 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); }, |
