summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/editor
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-04-18 18:20:40 +0200
committerChristophe Simonis <chs@odoo.com>2018-04-18 18:20:40 +0200
commitfed775bc0c2d70463206bbdddd3cce9ae8469e6a (patch)
tree03fd8410a57a49c39658f1ba184e29ccef5b3291 /addons/web_editor/static/src/js/editor
parent4d2e22bc392f27d920542e6ca025273080e5df77 (diff)
parent8c64159b8847dc465a21415c085d6526d280be02 (diff)
[MERGE] forward port branch 11.0 up to 8c64159b884
Diffstat (limited to 'addons/web_editor/static/src/js/editor')
-rw-r--r--addons/web_editor/static/src/js/editor/rte.summernote.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/addons/web_editor/static/src/js/editor/rte.summernote.js b/addons/web_editor/static/src/js/editor/rte.summernote.js
index fb4d6fc7206..f6e2ac63aa9 100644
--- a/addons/web_editor/static/src/js/editor/rte.summernote.js
+++ b/addons/web_editor/static/src/js/editor/rte.summernote.js
@@ -397,6 +397,7 @@ eventHandler.modules.imageDialog.showImageDialog = function ($editable) {
media: media,
options: {
lastFilters: ['background'],
+ onUpload: $editable.data('callbacks').onImageUpload,
},
});
return new $.Deferred().reject();
@@ -788,6 +789,14 @@ eventHandler.attach = function (oLayoutInfo, options) {
$(document).on("keyup", reRangeSelectKey);
var clone_data = false;
+
+ if (options.model) {
+ oLayoutInfo.editable().data({'oe-model': options.model, 'oe-id': options.id});
+ }
+ if (options.getMediaDomain) {
+ oLayoutInfo.editable().data('oe-media-domain', options.getMediaDomain);
+ }
+
var $node = oLayoutInfo.editor();
if ($node.data('oe-model') || $node.data('oe-translation-id')) {
$node.on('content_changed', function () {
@@ -1089,6 +1098,7 @@ var SummernoteManager = Class.extend(mixins.EventDispatcherMixin, {
_.extend({
res_model: data.$editable.data('oe-model'),
res_id: data.$editable.data('oe-id'),
+ domain: data.$editable.data('oe-media-domain'),
}, data.options),
data.$editable,
data.media