mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-10-24 22:59:51 -04:00
Replace deselect with more general content access method
This commit is contained in:
1 parent
edea003b2f
commit
57ab79d598
3 files changed
+13
-13
No files matched your search
@@ -148,8 +148,8 @@ export class View extends HTMLElement {
|
||||
return this.addAnnotation(annotation, true)
|
||||
}
|
||||
#getOverlayer(index) {
|
||||
const obj = this.renderer.getOverlayer()
|
||||
if (obj.index === index) return obj
|
||||
return this.renderer.getContents()
|
||||
.find(x => x.index === index && x.overlayer)
|
||||
}
|
||||
#createOverlayer({ doc, index }) {
|
||||
const overlayer = new Overlayer()
|
||||
@@ -218,7 +218,8 @@ export class View extends HTMLElement {
|
||||
}
|
||||
}
|
||||
deselect() {
|
||||
return this.renderer.deselect?.()
|
||||
for (const { doc } of this.renderer.getContents())
|
||||
doc.defaultView.getSelection().removeAllRanges()
|
||||
}
|
||||
async getTOCItemOf(target) {
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user