[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) <qsm@odoo.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user