menu: Don't scroll to top when clicking info

This commit is contained in:
Igor Scheller 2023-04-16 19:33:13 +02:00
parent a0c879948d
commit 16632706e0
1 changed files with 12 additions and 0 deletions

View File

@ -313,3 +313,15 @@ ready(() => {
});
}
});
/**
* Prevent scrolling on # links in menu
*/
ready(() => {
const elements = document.querySelectorAll('.navbar a[href="#"]');
elements.forEach((a) => {
a.addEventListener('click', (e) => {
e.preventDefault();
});
});
});