diff --git a/addons/web_editor/static/src/js/rte.summernote.js b/addons/web_editor/static/src/js/rte.summernote.js index 2c7e4a6ad44..4e4af30f5aa 100644 --- a/addons/web_editor/static/src/js/rte.summernote.js +++ b/addons/web_editor/static/src/js/rte.summernote.js @@ -258,13 +258,6 @@ eventHandler.modules.popover.update = function ($popover, oStyle, isAirMode) { fn_popover_update.call(this, $popover, oStyle, isAirMode); - if (!isAirMode || (oStyle.range && $(oStyle.range.sc).closest('[data-oe-model]:not([data-oe-model="ir.ui.view"]):not([data-oe-type="html"])').length)) { - $imagePopover.hide(); - $linkPopover.hide(); - $airPopover.hide(); - return; - } - if (oStyle.image) { if (oStyle.image.parentNode.className.match(/(^|\s)media_iframe_video(\s|$)/i)) { oStyle.image = oStyle.image.parentNode; diff --git a/addons/web_editor/static/src/js/widgets.js b/addons/web_editor/static/src/js/widgets.js index 236b1dc4fc8..6dcd47ee802 100644 --- a/addons/web_editor/static/src/js/widgets.js +++ b/addons/web_editor/static/src/js/widgets.js @@ -603,6 +603,9 @@ rte.Class.include({ $editable.attr('contenteditable', false); $editable.find('.oe_currency_value').attr('contenteditable', true); } + if ($editable.is('[data-oe-model]') && !$editable.is('[data-oe-model="ir.ui.view"]') && !$editable.is('[data-oe-type="html"]')) { + $editable.data('layoutInfo').popover().find('.btn-group:not(.note-history)').remove(); + } }, });