diff options
| author | Benjamin Vray <bvr@odoo.com> | 2020-12-04 09:44:48 +0000 |
|---|---|---|
| committer | Benjamin Vray <bvr@odoo.com> | 2020-12-04 15:04:04 +0000 |
| commit | 334bf078a4bfd600e1be4b22fc2511ca58aa4e94 (patch) | |
| tree | d2d2779cac923df0692105fadcf5250950cf66e8 /addons/website_profile/static/src/js/website_profile.js | |
| parent | df73b63bd73b52716c2b4d0b5c42962afe081be3 (diff) | |
[FIX] website_forum, website_profile: disable editor toolbar options
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) <jke@openerp.com>
Diffstat (limited to 'addons/website_profile/static/src/js/website_profile.js')
| -rw-r--r-- | addons/website_profile/static/src/js/website_profile.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/addons/website_profile/static/src/js/website_profile.js b/addons/website_profile/static/src/js/website_profile.js index 8030d06f0fe..105bdb03033 100644 --- a/addons/website_profile/static/src/js/website_profile.js +++ b/addons/website_profile/static/src/js/website_profile.js @@ -60,13 +60,26 @@ publicWidget.registry.websiteProfileEditor = publicWidget.Widget.extend({ return def; } + // 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']], + ['para', ['ul', 'ol', 'paragraph']], + ['table', ['table']], + ['insert', ['link', 'picture']], + ['history', ['undo', 'redo']], + ]; + var $textarea = this.$('textarea.o_wysiwyg_loader'); var loadProm = wysiwygLoader.load(this, $textarea[0], { + toolbar: toolbar, recordInfo: { context: this._getContext(), res_model: 'res.users', res_id: parseInt(this.$('input[name=user_id]').val()), }, + disableResizeImage: true, }).then(wysiwyg => { this._wysiwyg = wysiwyg; }); |
