Skip to content
Snippets Groups Projects
Commit f5fca171 authored by Huy Lee's avatar Huy Lee
Browse files

[FIX] website: cannot navigate to anchor link

After commit [1], the check that the target url is different from
the current page's url has been removed thus leading to error that anchor
link always scroll down to element that have data-anchor enabled.

Steps to reproduce (the easiest way):
- Install Website Blog
- Turn on customize comment on post
- Go incognito then access any blog post, scroll down and click the
`Sign in to leave a comment` button
- Holy, the page scrolls down to the discussion section but doesn't go
to the login page

[1]: https://github.com/odoo/odoo/commit/fb087dbec96f5e533d1fdd9c2b0c2e00296c83de



closes odoo/odoo#135620

Signed-off-by: default avatarBenjamin Vray (bvr) <bvr@odoo.com>
parent c32720db
No related branches found
No related tags found
No related merge requests found
......@@ -981,6 +981,9 @@ registry.anchorSlide = publicWidget.Widget.extend({
* @private
*/
_onAnimateClick: function (ev) {
if (this.$target[0].pathname !== window.location.pathname) {
return;
}
var hash = this.$target[0].hash;
if (hash === '#top' || hash === '#bottom') {
// If the anchor targets #top or #bottom, directly call the
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment