summaryrefslogtreecommitdiff
path: root/animism-align/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'animism-align/frontend')
-rw-r--r--animism-align/frontend/app/views/paragraph/components/paragraph.list.js12
-rw-r--r--animism-align/frontend/app/views/viewer/transcript/transcript.css3
2 files changed, 9 insertions, 6 deletions
diff --git a/animism-align/frontend/app/views/paragraph/components/paragraph.list.js b/animism-align/frontend/app/views/paragraph/components/paragraph.list.js
index 1a83569..fdb0f85 100644
--- a/animism-align/frontend/app/views/paragraph/components/paragraph.list.js
+++ b/animism-align/frontend/app/views/paragraph/components/paragraph.list.js
@@ -36,21 +36,20 @@ class ParagraphList extends Component {
setCurrentAnnotation(paragraph, play_ts) {
const { id: currentParagraph, annotations } = paragraph
+ const possibleAnnotations = annotations.filter(a => a.type !== 'footnote')
let currentAnnotation
let annotation
let i = 0, next_i
- let len = annotations.length
+ let len = possibleAnnotations.length
for (let i = 0; i < len - 1; i++) {
next_i = i + 1
- if (annotations[next_i].type === 'footnote') next_i += 1
- if (next_i < len && floatLT(play_ts, annotations[next_i].start_ts)) {
- currentAnnotation = annotations[i].id
+ if (next_i < len && floatLT(play_ts, possibleAnnotations[next_i].start_ts)) {
+ currentAnnotation = possibleAnnotations[i].id
break
}
}
- console.log(currentAnnotation)
if (!currentAnnotation) {
- currentAnnotation = annotations[len-1].id
+ currentAnnotation = possibleAnnotations[len-1].id
}
this.setState({ currentParagraph, currentAnnotation })
}
@@ -62,6 +61,7 @@ class ParagraphList extends Component {
onAnnotationClick, onParagraphDoubleClick,
} = this.props
const { currentParagraph, currentAnnotation } = this.state
+ console.log(currentParagraph, currentAnnotation)
return paragraphs.map((paragraph, i) => {
if (selectedParagraph && selectedParagraph.id === paragraph.id) {
paragraph = selectedParagraph
diff --git a/animism-align/frontend/app/views/viewer/transcript/transcript.css b/animism-align/frontend/app/views/viewer/transcript/transcript.css
index ed479f2..bc7f32c 100644
--- a/animism-align/frontend/app/views/viewer/transcript/transcript.css
+++ b/animism-align/frontend/app/views/viewer/transcript/transcript.css
@@ -133,4 +133,7 @@
left: -0.4rem;
margin-right: -0.2rem;
cursor: pointer;
+}
+.transcript .paragraph .current + .footnote {
+ background: #e8e8e8;
} \ No newline at end of file