-
- Downloads
[FIX] website: fix the scrollspy on table of content
Steps to reproduce: - Add a "Table Of Content" snippet from the website editor. - Save > The effect on the active page item (in top menu) is removed. Starting from [1], a `.scrollspy('dispose')` call was added to destroy the existing ScrollSpy, and to be able to make a new call that works correctly when the header height changed. Since this call has no specific target as option, it will trigger the `scrollspy._clear()` process on all `'.nav-link'` elements including navbar items which removes the `'active'` class from current page link. The goal of this commit is to fix this behaviour by calling the 'dispose' only when an instance of `Scrollspy` exists. [1]: https://github.com/odoo/odoo/commit/476995ba5a1d33aa0590214609346557d1d471c0 task-3223277 closes odoo/odoo#114937 Signed-off-by:Vray Benjamin (bvr) <bvr@odoo.com>