From b7818fe036d84ccb67828edafa47a5194cb91d4c Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Thu, 14 Feb 2019 15:46:27 +0000 Subject: [PATCH] [FIX] website: don't not edit not editable contents or branded hr, br... --- addons/website/static/src/js/editor/editor_menu.js | 4 +++- addons/website/static/src/js/editor/wysiwyg_multizone.js | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/website/static/src/js/editor/editor_menu.js b/addons/website/static/src/js/editor/editor_menu.js index 19cffd3f3aa..0e967b2f679 100644 --- a/addons/website/static/src/js/editor/editor_menu.js +++ b/addons/website/static/src/js/editor/editor_menu.js @@ -136,12 +136,14 @@ var EditorMenu = Widget.extend({ return $wrapwrap.find('[data-oe-model]') .not('.o_not_editable') .filter(function () { - return !$(this).closest('.o_not_editable').length; + var $parent = $(this).closest('.o_editable, .o_not_editable'); + return !$parent.length || $parent.hasClass('o_editable'); }) .not('link, script') .not('[data-oe-readonly]') .not('img[data-oe-field="arch"], br[data-oe-field="arch"], input[data-oe-field="arch"]') .not('.oe_snippet_editor') + .not('hr, br, input, textarea') .add('.o_editable'); }, diff --git a/addons/website/static/src/js/editor/wysiwyg_multizone.js b/addons/website/static/src/js/editor/wysiwyg_multizone.js index 1d264eff436..00098cd5b54 100644 --- a/addons/website/static/src/js/editor/wysiwyg_multizone.js +++ b/addons/website/static/src/js/editor/wysiwyg_multizone.js @@ -199,7 +199,6 @@ var WysiwygMultizone = Wysiwyg.extend({ self.$('[data-oe-readonly]').addClass('o_not_editable').attr('contenteditable', false); self.$('.oe_structure').attr('contenteditable', false).addClass('o_fake_not_editable'); self.$('[data-oe-field][data-oe-type="image"]').attr('contenteditable', false).addClass('o_fake_not_editable'); - self.$('[data-oe-field]:not([contenteditable])').attr('contenteditable', true).addClass('o_fake_editable'); }); }, /**