fix: don't create duplicate annotation elements
This commit is contained in:
parent
a614f9b2a0
commit
d3b40590de
@ -32,9 +32,11 @@ function getAnnotation(e) {
|
|||||||
annotationDiv.innerHTML = parsedReponse.html
|
annotationDiv.innerHTML = parsedReponse.html
|
||||||
annotationDiv.id = uri
|
annotationDiv.id = uri
|
||||||
annotationDiv.className = "annotation"
|
annotationDiv.className = "annotation"
|
||||||
|
if (!document.getElementById(uri)) {
|
||||||
e.target.parentElement.insertAdjacentElement('afterend', annotationDiv)
|
e.target.parentElement.insertAdjacentElement('afterend', annotationDiv)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window._currentTheme = localStorage.getItem("_theme") || "light"
|
window._currentTheme = localStorage.getItem("_theme") || "light"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user