From 968c13103f768a359f6b13d5fd4fa3c92f8b0542 Mon Sep 17 00:00:00 2001 From: Ipsita Borisagar Date: Thu, 21 Jul 2022 11:12:44 +0000 Subject: [PATCH] [FIX] web_editor: error while changing background color of button Before this commit: When we want to change the background color of a button, clicking on that button will occur traceback(dropdown is not a function). After this commit: Traceback will not occur by initializing the dropdown component as it has converted into the OWL component. Task-2916277 closes odoo/odoo#96508 Signed-off-by: David Monjoie (dmo) --- addons/web_editor/static/src/js/wysiwyg/wysiwyg.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js index 42c257be833..d960b993000 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -1572,7 +1572,9 @@ const Wysiwyg = Widget.extend({ oldColorpicker.destroy(); } manualOpening = true; - $dropdown.children('.dropdown-toggle').dropdown('show'); + const $childElement = $dropdown.children('.dropdown-toggle'); + const dropdownToggle = new Dropdown($childElement); + dropdownToggle.show(); const $colorpicker = $dropdown.find('.colorpicker'); const colorpickerHeight = $colorpicker.outerHeight(); const toolbarContainerTop = dom.closestScrollable(this.toolbar.el).getBoundingClientRect().top;