From 334bf078a4bfd600e1be4b22fc2511ca58aa4e94 Mon Sep 17 00:00:00 2001 From: Benjamin Vray Date: Fri, 4 Dec 2020 09:44:48 +0000 Subject: [FIX] website_forum, website_profile: disable editor toolbar options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit, the inline style added with some options of the editor toolbar when editing a textarea was removed due to the strip_style of the content field. Since we cannot remove this strip_style for security reasons, we can only disable options that add inline style. This commit closes #34288 closes odoo/odoo#62906 X-original-commit: 74e4114e20186e31343af12a673fa3e4bc4eac4a Signed-off-by: Jérémy Kersten (jke) --- addons/website_forum/static/src/js/website_forum.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'addons/website_forum/static/src/js') diff --git a/addons/website_forum/static/src/js/website_forum.js b/addons/website_forum/static/src/js/website_forum.js index 7c084751d52..46b6a389c5d 100644 --- a/addons/website_forum/static/src/js/website_forum.js +++ b/addons/website_forum/static/src/js/website_forum.js @@ -119,6 +119,8 @@ publicWidget.registry.websiteForum = publicWidget.Widget.extend({ var editorKarma = $textarea.data('karma') || 0; // default value for backward compatibility var $form = $textarea.closest('form'); var hasFullEdit = parseInt($("#karma").val()) >= editorKarma; + // Warning: Do not activate any option that adds inline style. + // Because the style is deleted after save. var toolbar = [ ['style', ['style']], ['font', ['bold', 'italic', 'underline', 'clear']], @@ -141,6 +143,7 @@ publicWidget.registry.websiteForum = publicWidget.Widget.extend({ res_model: 'forum.post', res_id: +window.location.pathname.split('-').pop(), }, + disableResizeImage: true, }; if (!hasFullEdit) { options.plugins = { -- cgit v1.2.3