diff options
| author | Samuel Degueldre <sad@odoo.com> | 2020-04-28 08:28:34 +0000 |
|---|---|---|
| committer | Samuel Degueldre <sad@odoo.com> | 2020-05-20 09:55:16 +0000 |
| commit | ecfef7abbab160585f147387904b67d6f014d8d7 (patch) | |
| tree | b105d99c3dce3ccc0914794b530e7129559abd5c /addons/website_blog/static/src | |
| parent | 9f3a12b9f0c3ecfbeb58212a04e264ddc4e6f602 (diff) | |
[FIX] website_blog: fix transition animation when going to next post
In odoo/odoo#38950 the navbar was reworked such that there is only one,
instead of using two different copies for when the user is at the top of
the page vs when the user has scrolled a little. The transition
animation to the next blog post used the first navbar's top offset to
compute where it should scroll, which is no longer correct.
This commit fixes that by using the content's offset instead, which
should always be correct.
closes odoo/odoo#51599
X-original-commit: 85cc286ff7b04eaf624082b761e14bbdde50ac76
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/website_blog/static/src')
| -rw-r--r-- | addons/website_blog/static/src/js/website_blog.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/website_blog/static/src/js/website_blog.js b/addons/website_blog/static/src/js/website_blog.js index 8f1f5e4951e..831bf4e7b4c 100644 --- a/addons/website_blog/static/src/js/website_blog.js +++ b/addons/website_blog/static/src/js/website_blog.js @@ -92,8 +92,8 @@ publicWidget.registry.websiteBlog = publicWidget.Widget.extend({ * @param {Function} callback - to be executed after the scroll is performed */ _forumScrollAction: function ($el, duration, callback) { - var $mainNav = $('#wrapwrap > header'); - var gap = $mainNav.height() + $mainNav.offset().top; + const $main = $('#wrapwrap > main'); + var gap = $main.offset().top + parseInt($main.css('padding-top')); $('html, body').stop().animate({ scrollTop: $el.offset().top - gap |
