summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/views/paragraph/components/paragraph.list.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-10-20 19:35:51 +0200
committerJules Laplace <julescarbon@gmail.com>2020-10-20 19:35:51 +0200
commitd7c729c1cbd319398933466d43a2868d1ab4c218 (patch)
tree66d119df71b211cf38c1a274f2e98ab3ea1ca74e /animism-align/frontend/app/views/paragraph/components/paragraph.list.js
parent1600ab3446f533a6824512d616131c7d02a037c7 (diff)
displaying footnotes in the paragraph editor
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
}