summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-01-12 19:13:10 +0100
committerChristophe Simonis <chs@odoo.com>2018-01-12 19:13:10 +0100
commit03a36a9bbadbf874837ff85692a1d8f1c13cc36d (patch)
treeb50823afe76b8300faf02962bcd265fb3a8b3e60 /addons/web_editor/static/src/js
parent2304edd46cc12aaef4fddaa22887ff51f51581bc (diff)
parent56974322f8c67ec5680654ed4bcb08ca57117c46 (diff)
[MERGE] forward port branch saas-11.1 up to 56974322f8c
Diffstat (limited to 'addons/web_editor/static/src/js')
-rw-r--r--addons/web_editor/static/src/js/editor/rte.summernote.js5
1 files changed, 4 insertions, 1 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 7f82df2cb28..fb1ce3e12b4 100644
--- a/addons/web_editor/static/src/js/editor/rte.summernote.js
+++ b/addons/web_editor/static/src/js/editor/rte.summernote.js
@@ -388,9 +388,12 @@ eventHandler.modules.imageDialog.showImageDialog = function ($editable) {
if (r.sc.tagName && r.sc.childNodes.length) {
r.sc = r.sc.childNodes[r.so];
}
+ var media = $(r.sc).parents().addBack().filter(function (i, el) {
+ return dom.isImg(el);
+ })[0];
core.bus.trigger('media_dialog_demand', {
$editable: $editable,
- media: dom.isImg(r.sc) ? r.sc : null,
+ media: media,
});
return new $.Deferred().reject();
};