diff options
| author | Benjamin Vray <bvr@odoo.com> | 2020-09-25 11:03:47 +0000 |
|---|---|---|
| committer | Benjamin Vray <bvr@odoo.com> | 2020-09-29 07:57:45 +0000 |
| commit | a0ef5b0ea5e6025d6121849c2c98c077d86e237b (patch) | |
| tree | 0cbd8f2a30d9cd36058679fa1006e124c07b39a9 /addons/website/static | |
| parent | 7118288355e035f07da8b76d3f9ecefd2375e937 (diff) | |
[FIX] website: fix table of content navbar links when scrolling
Before this commit active navbar links were not correctly updated with
the scroll position.
task-2312878
closes odoo/odoo#58505
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/website/static')
| -rw-r--r-- | addons/website/static/src/snippets/s_table_of_content/000.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/addons/website/static/src/snippets/s_table_of_content/000.js b/addons/website/static/src/snippets/s_table_of_content/000.js index 68250bc88fa..a98727a1306 100644 --- a/addons/website/static/src/snippets/s_table_of_content/000.js +++ b/addons/website/static/src/snippets/s_table_of_content/000.js @@ -39,6 +39,9 @@ const TableOfContent = publicWidget.Widget.extend({ const isHorizontalNavbar = this.$target.hasClass('s_table_of_content_horizontal_navbar'); this.$target.css('top', isHorizontalNavbar ? position : ''); this.$target.find('.s_table_of_content_navbar').css('top', isHorizontalNavbar ? '' : position + 20); + const $mainNavBar = $('#oe_main_menu_navbar'); + position += $mainNavBar.length ? $mainNavBar.outerHeight() : 0; + position += isHorizontalNavbar ? this.$target.outerHeight() : 0; $().getScrollingElement().scrollspy({target: '.s_table_of_content_navbar', method: 'offset', offset: position + 100}); }, }); |
