From e7f497b027d5931b1cf57febcab5deda573b45bb Mon Sep 17 00:00:00 2001 From: Younn Olivier Date: Wed, 30 Jun 2021 09:49:23 +0000 Subject: [PATCH] [FIX] web_editor: reintroduce request_editable event The commit fixes the display of custom colors in the color picker. It improves previous fix from #72294, which was not returning all editables from the editor, thus only the custom colors of the target were displayed. For that the request_editable event is reintroduced at the SnippetsMenu level. Part of https://github.com/odoo/odoo/pull/72978 task-2476601 X-original-commit: 68d7d42cce012269342e18373a30970e2c582ba3 --- addons/web_editor/static/src/js/editor/snippets.editor.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/web_editor/static/src/js/editor/snippets.editor.js b/addons/web_editor/static/src/js/editor/snippets.editor.js index c6f989fc970..47f021727c4 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -1091,6 +1091,7 @@ var SnippetsMenu = Widget.extend({ 'user_value_widget_opening': '_onUserValueWidgetOpening', 'user_value_widget_closing': '_onUserValueWidgetClosing', 'reload_snippet_template': '_onReloadSnippetTemplate', + 'request_editable': '_onRequestEditable', }, // enum of the SnippetsMenu's tabs. tabs: { @@ -3052,6 +3053,13 @@ var SnippetsMenu = Widget.extend({ _onRedo: async function() { this.options.wysiwyg.redo(); }, + /** + * @private + * @param {OdooEvent} ev + */ + _onRequestEditable: function (ev) { + ev.data.callback($(this.options.wysiwyg.odooEditor.editable)); + }, }); return {