summaryrefslogtreecommitdiff
path: root/animism-align/frontend/app/utils
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/utils
parent1600ab3446f533a6824512d616131c7d02a037c7 (diff)
displaying footnotes in the paragraph editor
Diffstat (limited to 'animism-align/frontend/app/utils')
-rw-r--r--animism-align/frontend/app/utils/transcript.utils.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/animism-align/frontend/app/utils/transcript.utils.js b/animism-align/frontend/app/utils/transcript.utils.js
index dc351c0..2a089a0 100644
--- a/animism-align/frontend/app/utils/transcript.utils.js
+++ b/animism-align/frontend/app/utils/transcript.utils.js
@@ -87,9 +87,13 @@ export const buildParagraphs = (annotationOrder, sectionCount, footnoteCount) =>
paragraphs.push(currentParagraph)
}
+ // accumulate footnotes
if (annotation.type === 'footnote') {
+ // bump footnote count and attach it to this annotation, so we can find it later
footnoteCount += 1
annotation.footnote_id = footnoteCount
+ // set annotation start point to the start of the previous sentence
+ annotation.start_ts = currentParagraph.annotations[currentParagraph.annotations.length - 1].start_ts
footnotes.push(annotation)
}