summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/editor/snippets.options.js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-02-09 16:13:08 +0100
committerChristophe Simonis <chs@odoo.com>2018-02-09 16:13:08 +0100
commit5f3301e5cbbb2c6e7bff732761eef80e8dd5a33d (patch)
tree48ab6bd9bbda92dea713c0c52bca3396ef939d82 /addons/web_editor/static/src/js/editor/snippets.options.js
parent715e602bf04ae5a0c9704c599f2145b2808b31b7 (diff)
parent20e4cd5bcd1816a478aedd441efa90a34cf63334 (diff)
[MERGE] forward port branch 11.0 up to 20e4cd5bcd1
Diffstat (limited to 'addons/web_editor/static/src/js/editor/snippets.options.js')
-rw-r--r--addons/web_editor/static/src/js/editor/snippets.options.js7
1 files changed, 6 insertions, 1 deletions
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 38dcacf9e77..382bae0d4a7 100644
--- a/addons/web_editor/static/src/js/editor/snippets.options.js
+++ b/addons/web_editor/static/src/js/editor/snippets.options.js
@@ -872,7 +872,12 @@ registry.background = SnippetOption.extend({
// Put fake image in the DOM, edit it and use it as background-image
var $image = $('<img/>', {class: 'hidden', src: value}).appendTo(this.$target);
- var _editor = new widget.MediaDialog(this, {}, null, $image[0]).open();
+ var $editable = this.$target.closest('.o_editable');
+ var options = {
+ res_model: $editable.data('oe-model'),
+ res_id: $editable.data('oe-id'),
+ };
+ var _editor = new widget.MediaDialog(this, options, null, $image[0]).open();
_editor.opened(function () {
_editor.$('[href="#editor-media-video"], [href="#editor-media-icon"]').addClass('hidden');
});