From 82ba0ce0811bb4c39cfb27ce9b33e1cb465d138a Mon Sep 17 00:00:00 2001 From: Antoine Guenet Date: Thu, 1 Apr 2021 09:08:16 +0000 Subject: [PATCH] [REF] web_editor, website_forum: remove unused wysiwyg options Some instance options of Summernote remained in the code after replacing Summernote with Odoo-Editor. This removes them as they effectively did nothing. --- .../static/src/js/wysiwyg/wysiwyg.js | 25 +++---------------- .../static/src/js/website_forum.js | 4 --- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js index a809fdfcabf..bc8f05795a0 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -31,24 +31,9 @@ const Wysiwyg = Widget.extend({ xmlDependencies: [ ], defaultOptions: { - 'focus': false, - 'toolbar': [ - ['style', ['style']], - ['font', ['bold', 'italic', 'underline', 'clear']], - ['fontsize', ['fontsize']], - ['color', ['color']], - ['para', ['ul', 'ol', 'paragraph']], - ['table', ['table']], - ['insert', ['link', 'picture']], - ['history', ['undo', 'redo']], - ], - 'styleWithSpan': false, - 'inlinemedia': ['p'], - 'lang': 'odoo', - 'colors': customColors, - recordInfo: { - context: {}, - }, + lang: 'odoo', + colors: customColors, + recordInfo: {context: {}}, }, init: function (parent, options) { this._super.apply(this, arguments); @@ -1022,10 +1007,6 @@ const Wysiwyg = Widget.extend({ _editorOptions: function () { var self = this; var options = Object.assign({}, this.defaultOptions, this.options); - if (this.options.generateOptions) { - options = this.options.generateOptions(options); - } - options.airPopover = options.toolbar; options.onChange = function (html, $editable) { $editable.trigger('content_changed'); self.trigger_up('wysiwyg_change'); diff --git a/addons/website_forum/static/src/js/website_forum.js b/addons/website_forum/static/src/js/website_forum.js index 01ef3c7d51e..15cc5a69f5c 100644 --- a/addons/website_forum/static/src/js/website_forum.js +++ b/addons/website_forum/static/src/js/website_forum.js @@ -124,16 +124,12 @@ publicWidget.registry.websiteForum = publicWidget.Widget.extend({ var hasFullEdit = parseInt($("#karma").val()) >= editorKarma; var options = { - height: 200, - minHeight: 80, toolbarTemplate: 'website_forum.web_editor_toolbar', - styleWithSpan: false, recordInfo: { context: self._getContext(), res_model: 'forum.post', res_id: +window.location.pathname.split('-').pop(), }, - disableFullMediaDialog: true, resizable: true, }; if (!hasFullEdit) {