From 5d7f883a2cc7283b09af67fc27dea1e74bebdaab Mon Sep 17 00:00:00 2001 From: Younn Olivier Date: Wed, 23 Jun 2021 14:22:20 +0000 Subject: [PATCH] [FIX] website: fix scrollButton option on events On events, or in every part of the website that was built without sections, the scroll button of a dropped snippet was not effective. This was because we were targeting the next section, which was not there in the previous case. Yet, we want it to scroll to the next element, even if it is not a section. task-2566338 closes odoo/odoo#72733 X-original-commit: 439381aa98c3b1e03513edb45cda284f4627d2a8 Signed-off-by: Quentin Smetz (qsm) --- addons/website/static/src/js/content/snippets.animation.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/website/static/src/js/content/snippets.animation.js b/addons/website/static/src/js/content/snippets.animation.js index 58e5bfded6d..07cc9c3fbb5 100644 --- a/addons/website/static/src/js/content/snippets.animation.js +++ b/addons/website/static/src/js/content/snippets.animation.js @@ -965,9 +965,9 @@ registry.ScrollButton = registry.anchorSlide.extend({ */ _onAnimateClick: function (ev) { ev.preventDefault(); - const $nextSection = this.$el.closest('section').next('section'); - if ($nextSection.length) { - this._scrollTo($nextSection); + const $nextElement = this.$el.closest('section').next(); + if ($nextElement.length) { + this._scrollTo($nextElement); } }, });