Commit 990f2767 authored by csillag's avatar csillag Committed by Randall Leeds

Simplify calculating the orphan flag

parent 19c817e9
......@@ -16,7 +16,6 @@ Annotator.prototype.setupAnnotation = (annotation) ->
@selectedTargets = []
annotation.anchors = []
hasAnchor = false
for t in annotation.target ? []
try
......@@ -28,13 +27,12 @@ Annotator.prototype.setupAnnotation = (annotation) ->
if anchor?
t.diffHTML = anchor.diffHTML
t.diffCaseOnly = anchor.diffCaseOnly
hasAnchor = true
catch exception
console.log "Error in setupAnnotation for", annotation.id,
":", exception.stack ? exception
if annotation.target?.length and not hasAnchor
if annotation.target?.length and not annotation.anchors?.length
annotation.$orphan = true
annotation
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment