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'); } }, });