summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/paragraph/components/paragraph.list.js
diff options
context:
space:
mode:
Diffstat (limited to 'animism-align/frontend/app/views/paragraph/components/paragraph.list.js')
-rw-r--r--animism-align/frontend/app/views/paragraph/components/paragraph.list.js7
1 files changed, 5 insertions, 2 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 94f4585..1a83569 100644
--- a/animism-align/frontend/app/views/paragraph/components/paragraph.list.js
+++ b/animism-align/frontend/app/views/paragraph/components/paragraph.list.js
@@ -38,14 +38,17 @@ class ParagraphList extends Component {
const { id: currentParagraph, annotations } = paragraph
let currentAnnotation
let annotation
- let i = 0
+ let i = 0, next_i
let len = annotations.length
for (let i = 0; i < len - 1; i++) {
- if (floatLT(play_ts, annotations[i+1].start_ts)) {
+ 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
break
}
}
+ console.log(currentAnnotation)
if (!currentAnnotation) {
currentAnnotation = annotations[len-1].id
}