Merge pull request #63 from sgvictorino/fix-annotation-exception

fix: don't error when clicks dispatch on annotation link child
This commit is contained in:
Achraf RRAMI 2024-07-13 20:22:17 +00:00 committed by GitHub
commit 492a56605a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -26,7 +26,7 @@ window.addEventListener("load", () => {
function getAnnotation(e) { function getAnnotation(e) {
e.preventDefault() e.preventDefault()
//document.querySelector('.annotation')?.remove() //document.querySelector('.annotation')?.remove()
const link = e.target.parentElement const link = e.currentTarget
const uri = link.getAttribute("href") const uri = link.getAttribute("href")
const presentAnnotation = link.nextElementSibling.matches(".annotation") && link.nextElementSibling const presentAnnotation = link.nextElementSibling.matches(".annotation") && link.nextElementSibling
if (presentAnnotation) { if (presentAnnotation) {