feat: more robust checking for exit link classes
This commit is contained in:
parent
656d6e5dd2
commit
f3698dc8a6
1 changed files with 3 additions and 3 deletions
|
|
@ -44,9 +44,9 @@
|
||||||
let target = e.target.closest("a");
|
let target = e.target.closest("a");
|
||||||
if (target) {
|
if (target) {
|
||||||
// if the click was on or within an <a>
|
// if the click was on or within an <a>
|
||||||
if (!target.className.includes("snap-skip-link") &&
|
if (!target.classList.contains("snap-skip-link") &&
|
||||||
!target.className.includes("snap-link--mirror") &&
|
!target.classList.contains("snap-link--mirror") &&
|
||||||
!target.className.includes("snap-link--snapshot")) {
|
!target.classList.contains("snap-link--snapshot")) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
document.body.dataset.currentLink = target.href;
|
document.body.dataset.currentLink = target.href;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue