mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-09 11:29:14 -04:00
Fix CFI for fixed-layout books
This commit is contained in:
@@ -163,8 +163,8 @@ export class View {
|
|||||||
this.emit?.({ type: 'show-annotation', value, range })
|
this.emit?.({ type: 'show-annotation', value, range })
|
||||||
}
|
}
|
||||||
getCFI(index, range) {
|
getCFI(index, range) {
|
||||||
if (!range) return ''
|
|
||||||
const baseCFI = this.book.sections[index].cfi ?? CFI.fake.fromIndex(index)
|
const baseCFI = this.book.sections[index].cfi ?? CFI.fake.fromIndex(index)
|
||||||
|
if (!range) return baseCFI
|
||||||
return CFI.joinIndir(baseCFI, CFI.fromRange(range))
|
return CFI.joinIndir(baseCFI, CFI.fromRange(range))
|
||||||
}
|
}
|
||||||
resolveCFI(cfi) {
|
resolveCFI(cfi) {
|
||||||
|
|||||||
Reference in New Issue
Block a user