Update helper code

This commit is contained in:
Ramon Wenger 2024-02-14 23:13:50 +01:00
parent 99c9a87247
commit c7fc0b00b7
1 changed files with 2 additions and 2 deletions

View File

@ -12,7 +12,7 @@ import popover from '@/helpers/popover';
// Also, we probably want to store the text of the selection at least, and maybe even some more for context? // Also, we probably want to store the text of the selection at least, and maybe even some more for context?
export interface Highlight { export interface Highlight {
contentBlock: string; // the id page: string; // the id
contentIndex: number; // which content of the .contents array do I come from? contentIndex: number; // which content of the .contents array do I come from?
contentUuid: string; // the wagtail UUID of the content element contentUuid: string; // the wagtail UUID of the content element
paragraphIndex: number; // which paragraph inside the textBlock do I come from? paragraphIndex: number; // which paragraph inside the textBlock do I come from?
@ -160,7 +160,7 @@ export const getSelectionHandler =
const { start, end } = range.toCharacterRange(startAncestor); const { start, end } = range.toCharacterRange(startAncestor);
const highlightedText: Highlight = { const highlightedText: Highlight = {
contentBlock: contentBlock.id, page: contentBlock.id,
contentIndex: position, contentIndex: position,
contentUuid: uuid, contentUuid: uuid,
startPosition: start, startPosition: start,