Commit 8d752fc5 authored by csillag's avatar csillag

Make the diffFromTargets method private

parent b44864c7
...@@ -128,12 +128,12 @@ AnnotationController = [ ...@@ -128,12 +128,12 @@ AnnotationController = [
@action = 'view' @action = 'view'
@editing = false @editing = false
###* # Calculates the visual diff flags from the targets
# @ngdoc method #
# @name annotation.AnnotationController.diffFromTarget # hasDiff is set to true is there are any targets with a difference
# @description Calculates the visual diff flags from the targets # shouldShowDiff is set to true if there are some meaningful differences
### # - that is, more than just uppercase / lowercase
this.diffFromTargets = (targets) -> diffFromTargets = (targets) ->
hasDiff = targets.filter((t) -> t.diffHTML?).length > 0 hasDiff = targets.filter((t) -> t.diffHTML?).length > 0
shouldShowDiff = hasDiff and shouldShowDiff = hasDiff and
targets.filter((t) -> t.diffHTML? and not t.diffCaseOnly).length > 0 targets.filter((t) -> t.diffHTML? and not t.diffCaseOnly).length > 0
...@@ -227,7 +227,7 @@ AnnotationController = [ ...@@ -227,7 +227,7 @@ AnnotationController = [
@annotation.tags = ({text} for text in (model.tags or [])) @annotation.tags = ({text} for text in (model.tags or []))
# Calculate the visual diff flags # Calculate the visual diff flags
diffFlags = this.diffFromTargets(@annotation.target) diffFlags = diffFromTargets(@annotation.target)
@hasDiff = diffFlags.hasDiff @hasDiff = diffFlags.hasDiff
if @hasDiff if @hasDiff
# We don't want to override the showDiff value manually changed # We don't want to override the showDiff value manually changed
......
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