From b17a30f2d9bdb8cccd0d0c42feedaf3303b57e4b Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Tue, 22 Mar 2022 10:10:26 +0000 Subject: [PATCH] [FIX] website: hide the "animation launch" option for imgs in dropdowns Since [1], that feature was lost because a `_computeWidgetVisibility` was duplicated inside of the same class. The feature is now restored, indeed the option does not make sense as animations will always launch on every dropdown openings no matter the configuration. [1]: https://github.com/odoo/odoo/commit/187acb938f70a2130d25fa76079221339c742f1e X-original-commit: bde55751608b1679bd6599238a4da6279b8f74fa Part-of: odoo/odoo#90832 Co-authored-by: xO-Tx --- .../website/static/src/js/editor/snippets.options.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/addons/website/static/src/js/editor/snippets.options.js b/addons/website/static/src/js/editor/snippets.options.js index d43f46fc37e..a0a14aa1e9c 100644 --- a/addons/website/static/src/js/editor/snippets.options.js +++ b/addons/website/static/src/js/editor/snippets.options.js @@ -3054,15 +3054,6 @@ options.registry.WebsiteAnimate = options.Class.extend({ this.$target.toggleClass('o_animate_preview o_animate', !!widgetValue); } }, - /** - * @override - */ - async _computeWidgetVisibility(widgetName, params) { - if (widgetName === 'animation_launch_opt') { - return !this.$target[0].closest('.dropdown'); - } - return this._super(...arguments); - }, //-------------------------------------------------------------------------- // Private @@ -3091,6 +3082,9 @@ options.registry.WebsiteAnimate = options.Class.extend({ if (widgetName === 'no_animation_opt') { return !this.isAnimatedText; } + if (widgetName === 'animation_launch_opt') { + return !this.$target[0].closest('.dropdown'); + } return this._super(...arguments); }, });