Replace deselect with more general content access method

This commit is contained in:
John Factotum
2023-05-16 19:12:26 +08:00
parent edea003b2f
commit 57ab79d598
3 changed files with 13 additions and 13 deletions
+5 -3
View File
@@ -279,9 +279,11 @@ export class FixedLayout extends HTMLElement {
if (s) this.#reportLocation()
else return this.goToSpread(this.#index - 1, this.rtl ? 'left' : 'right')
}
deselect() {
for (const frame of this.#root.querySelectorAll('iframe'))
frame.contentWindow.getSelection().removeAllRanges()
getContents() {
return Array.from(this.#root.querySelectorAll('iframe'), frame => ({
doc: frame.contentDocument,
// TODO: index, overlayer
}))
}
destroy() {
this.#observer.unobserve(this)