From aa375d940f4d6c124c306575c0b3fdc7e73a5c73 Mon Sep 17 00:00:00 2001 From: Benjamin Vray Date: Tue, 29 Sep 2020 07:10:22 +0000 Subject: [PATCH] [FIX] website: fix full height snippet option Before this commit the height of a snippet with the full height option enabled was not correctly updated. task-2312878 closes odoo/odoo#58782 X-original-commit: b371cb42cb67115692464c102813b7ebd54785d9 Signed-off-by: Quentin Smetz (qsm) --- addons/website/static/src/js/content/snippets.animation.js | 3 ++- 1 file changed, 2 insertions(+), 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 368be2e810b..d3401a1f196 100644 --- a/addons/website/static/src/js/content/snippets.animation.js +++ b/addons/website/static/src/js/content/snippets.animation.js @@ -984,7 +984,8 @@ registry.FullScreenHeight = publicWidget.Widget.extend({ const windowHeight = $(window).outerHeight(); // Doing it that way allows to considerer fixed headers, hidden headers, // connected users, ... - const mainTopPos = $('#wrapwrap > main')[0].getBoundingClientRect().top; + const firstContentEl = $('#wrapwrap > main > :first-child')[0]; // first child to consider the padding-top of main + const mainTopPos = firstContentEl.getBoundingClientRect().top + dom.closestScrollable(firstContentEl.parentNode).scrollTop; return (windowHeight - mainTopPos); }, });