Skip to content

Commit

Permalink
fix: don't create duplicate annotation elements
Browse files Browse the repository at this point in the history
  • Loading branch information
sgvictorino committed Apr 6, 2024
1 parent a614f9b commit d3b4059
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion static/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ function getAnnotation(e) {
annotationDiv.innerHTML = parsedReponse.html
annotationDiv.id = uri
annotationDiv.className = "annotation"
e.target.parentElement.insertAdjacentElement('afterend', annotationDiv)
if (!document.getElementById(uri)) {
e.target.parentElement.insertAdjacentElement('afterend', annotationDiv)
}
}
}
}
Expand Down

0 comments on commit d3b4059

Please sign in to comment.