[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 <mou@odoo.com>
This commit is contained in:
qsm-odoo
2022-05-10 15:16:44 +02:00
co-authored by xO-Tx
parent 339cdffb68
commit b17a30f2d9
@@ -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);
},
});