UNPKG

@snippetify/book-reader-component

Version:
15 lines (14 loc) 459 B
export class Selection { constructor(data) { this.content = data.content; this.pages = data.pages || []; this.serialized = data.serialized; this.references = data.references || []; // Paragraph positions in page start from 1 } isOnSinglePage() { return this.pages.length === 1 || this.pages[0] === this.pages[1]; } isOnSingleELement() { return this.references.length === 1 || this.references[0] === this.references[1]; } }