Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
8a500a03
Commit
8a500a03
authored
Nov 22, 2014
by
Randall Leeds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Track diff per-target and set/unset showDiff
parent
fbd715dd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
annotation.coffee
h/static/scripts/directives/annotation.coffee
+6
-2
annotation.html
h/templates/client/annotation.html
+2
-2
No files found.
h/static/scripts/directives/annotation.coffee
View file @
8a500a03
...
...
@@ -45,6 +45,8 @@ AnnotationController = [
@preview = 'no'
@editing = false
@embedded = false
@hasDiff = false
@showDiff = undefined
highlight = annotator.tool is 'highlight'
model = $scope.annotationGet()
...
...
@@ -206,8 +208,10 @@ AnnotationController = [
@annotation.tags = ({text} for text in (model.tags or []))
# Calculate the visual diff flags
@hasDiff = @annotation.target.filter((t) -> t.diffHTML?).length > 0
@showDiff ?= @hasDiff && @annotation.target.filter((t) -> t.diffHTML? and not t.diffCaseOnly).length > 0
@hasDiff = false
for t in @annotation.target or [] when t.diffHTML? and not t.diffCaseOnly
@hasDiff = t.hasDiff = true
@showDiff ?= @hasDiff or undefined
# Export the baseURI for the share link
this.baseURI = documentHelpers.baseURI
...
...
h/templates/client/annotation.html
View file @
8a500a03
...
...
@@ -44,14 +44,14 @@
<section
class=
"annotation-target"
ng-repeat=
"target in vm.annotation.target track by $index"
>
<blockquote
class=
"annotation-quote"
ng-hide=
"vm.showDiff"
ng-hide=
"
target.hasDiff &&
vm.showDiff"
ng-bind-html=
"selector.exact"
ng-repeat=
"selector in target.selector
| filter : {'type': 'TextQuoteSelector'}
track by $index"
></blockquote>
<blockquote
class=
"annotation-quote"
ng-bind-html=
"target.diffHTML"
ng-show=
"vm.showDiff"
></blockquote>
ng-show=
"
target.hasDiff &&
vm.showDiff"
></blockquote>
</section>
<div
class=
"small pull-right"
ng-show=
"vm.hasDiff"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment