improved link highlighting
This commit is contained in:
parent
49c1288a0b
commit
ddc0698605
@ -117,9 +117,7 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||||||
document.body.addEventListener("click", e => {
|
document.body.addEventListener("click", e => {
|
||||||
if (e.target.matches("[data-link]")) {
|
if (e.target.matches("[data-link]")) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
document.querySelectorAll('[data-link]').forEach(e => {
|
document.querySelector('[data-link].active').classList.remove('active');
|
||||||
e.classList.remove('active');
|
|
||||||
});
|
|
||||||
e.target.classList.add('active');
|
e.target.classList.add('active');
|
||||||
navigateTo(e.target.href.slice(location.origin.length));
|
navigateTo(e.target.href.slice(location.origin.length));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user