diff options
| author | David Monjoie <dmo@odoo.com> | 2019-08-07 06:25:50 +0000 |
|---|---|---|
| committer | David Monjoie <dmo@odoo.com> | 2019-08-07 08:49:46 +0000 |
| commit | 97e6b7f126584af854d5a67180240f4cc429a29b (patch) | |
| tree | 338cf69c48091a60c8110d28627b8dd3e1966100 /addons/web_editor/static/src | |
| parent | cfbe4bbe429de18b06ca78628cfe7c6caf98ea4c (diff) | |
[FIX] web_editor: fix snippets preview on drop not displaying
Diffstat (limited to 'addons/web_editor/static/src')
| -rw-r--r-- | addons/web_editor/static/src/js/wysiwyg/plugin/media.js | 2 | ||||
| -rw-r--r-- | addons/web_editor/static/src/js/wysiwyg_snippets/snippets.editor.js | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/wysiwyg/plugin/media.js b/addons/web_editor/static/src/js/wysiwyg/plugin/media.js index 6e539787a67..d08df439e2f 100644 --- a/addons/web_editor/static/src/js/wysiwyg/plugin/media.js +++ b/addons/web_editor/static/src/js/wysiwyg/plugin/media.js @@ -932,7 +932,7 @@ _.extend(wysiwygTranslation.image, { dom.isVideo = function (node) { node = node && !node.tagName ? node.parentNode : node; return (node.tagName === "IFRAME" || node.tagName === "DIV") && - (node.parentNode.className && node.parentNode.className.indexOf('media_iframe_video') !== -1 || + (node.parentNode && node.parentNode.className && node.parentNode.className.indexOf('media_iframe_video') !== -1 || node.className.indexOf('media_iframe_video') !== -1); }; diff --git a/addons/web_editor/static/src/js/wysiwyg_snippets/snippets.editor.js b/addons/web_editor/static/src/js/wysiwyg_snippets/snippets.editor.js index c325458b3f2..408e9607924 100644 --- a/addons/web_editor/static/src/js/wysiwyg_snippets/snippets.editor.js +++ b/addons/web_editor/static/src/js/wysiwyg_snippets/snippets.editor.js @@ -1359,6 +1359,7 @@ var SnippetsMenu = Widget.extend({ if (!dropped) { dropped = true; $(this).first().after($toInsert).addClass('d-none'); + $toInsert.removeClass('oe_snippet_body'); } }, out: function () { @@ -1367,6 +1368,7 @@ var SnippetsMenu = Widget.extend({ dropped = false; $toInsert.detach(); $(this).removeClass('d-none'); + $toInsert.addClass('oe_snippet_body'); } }, }); |
