Commit 481921fb authored by Randall Leeds's avatar Randall Leeds

Fix isHighlight and isComment logic

I acted too quickly on these edits. I can squash them up.
parent d30d7b72
...@@ -58,7 +58,7 @@ AnnotationController = [ ...@@ -58,7 +58,7 @@ AnnotationController = [
# @returns {boolean} True if the annotation is a comment. # @returns {boolean} True if the annotation is a comment.
### ###
this.isComment = -> this.isComment = ->
not (model.target.length or model.references) not (model.target?.length or model.references?.length)
###* ###*
# @ngdoc method # @ngdoc method
...@@ -66,7 +66,8 @@ AnnotationController = [ ...@@ -66,7 +66,8 @@ AnnotationController = [
# @returns {boolean} True if the annotation is a highlight. # @returns {boolean} True if the annotation is a highlight.
### ###
this.isHighlight = -> this.isHighlight = ->
not (model.text or model.deleted or model.tags.length) model.target?.length and not model.references?.length and
not (model.text or model.deleted or model.tags?.length)
###* ###*
# @ngdoc method # @ngdoc method
...@@ -219,7 +220,7 @@ AnnotationController = [ ...@@ -219,7 +220,7 @@ AnnotationController = [
this.render() this.render()
# Start editing brand new annotations immediately # Start editing brand new annotations immediately
unless model.id? or this.isHighlight() then this.edit() unless model.id? or (highlight and this.isHighlight()) then this.edit()
this this
] ]
......
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