From d7c729c1cbd319398933466d43a2868d1ab4c218 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 20 Oct 2020 19:35:51 +0200 Subject: displaying footnotes in the paragraph editor --- animism-align/frontend/app/utils/transcript.utils.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'animism-align/frontend/app/utils') 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) } -- cgit v1.2.3-70-g09d2