fix: don't create duplicate annotation elements

This commit is contained in:
Solomon Victorino 2024-04-06 14:17:42 -06:00
parent a614f9b2a0
commit d3b40590de

View File

@ -32,7 +32,9 @@ function getAnnotation(e) {
annotationDiv.innerHTML = parsedReponse.html annotationDiv.innerHTML = parsedReponse.html
annotationDiv.id = uri annotationDiv.id = uri
annotationDiv.className = "annotation" annotationDiv.className = "annotation"
e.target.parentElement.insertAdjacentElement('afterend', annotationDiv) if (!document.getElementById(uri)) {
e.target.parentElement.insertAdjacentElement('afterend', annotationDiv)
}
} }
} }
} }