From 4fb98f767a1209f2cc309c92e6bd67a178bbc24b Mon Sep 17 00:00:00 2001 From: Benjamin Vray Date: Thu, 19 May 2022 08:56:56 +0000 Subject: [PATCH] [FIX] website: fix animation in tabs and accordion blocks Before this commit, animated elements did not animate in a tab that just opened. Exact same problem was also happening with the accordion block. Steps to reproduce the issue (with the tabs block) : - Create a tabs block. - Add some content with animation on each tab. - Save. - When you refresh, the first animation loads. - Switch tab to another animation and wait - it won't load. - Scroll up or down -> animation will show up. opw-2813435 closes odoo/odoo#91850 X-original-commit: 2c21d5a7b493a3c88962ad9185391b6d6c7fc010 Signed-off-by: Quentin Smetz (qsm) --- addons/website/static/src/js/content/snippets.animation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website/static/src/js/content/snippets.animation.js b/addons/website/static/src/js/content/snippets.animation.js index 12a514d1fa0..0d08075d5d1 100644 --- a/addons/website/static/src/js/content/snippets.animation.js +++ b/addons/website/static/src/js/content/snippets.animation.js @@ -1214,7 +1214,7 @@ registry.WebsiteAnimate = publicWidget.Widget.extend({ this.__onScrollWebsiteAnimate = _.throttle(this._onScrollWebsiteAnimate.bind(this), 200); this.$scrollingElement[0].addEventListener('scroll', this.__onScrollWebsiteAnimate, {capture: true}); - $(window).on('resize.o_animate, shown.bs.modal.o_animate, slid.bs.carousel.o_animate', () => { + $(window).on('resize.o_animate, shown.bs.modal.o_animate, slid.bs.carousel.o_animate, shown.bs.tab.o_animate, shown.bs.collapse.o_animate', () => { this.windowsHeight = $(window).height(); this._scrollWebsiteAnimate(this.$scrollingElement[0]); }).trigger("resize");