mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-09 11:29:14 -04:00
Paginator: use CSS grid
Massively simplify margin/padding and header/footer layout and eliminate unnecessary resizes and resize loops. Also remove layout and style API from View, as these are only applicable to the paginator.
This commit is contained in:
@@ -83,7 +83,6 @@ export class View extends HTMLElement {
|
||||
#sectionProgress
|
||||
#tocProgress
|
||||
#pageProgress
|
||||
#css
|
||||
isFixedLayout = false
|
||||
lastLocation
|
||||
history = new History()
|
||||
@@ -162,7 +161,6 @@ export class View extends HTMLElement {
|
||||
if (!this.language.isCJK)
|
||||
doc.documentElement.dir ||= this.language.direction ?? ''
|
||||
|
||||
this.renderer.setStyle?.(this.#css)
|
||||
this.#handleLinks(doc, index)
|
||||
|
||||
this.#emit('load', { doc, index })
|
||||
@@ -315,13 +313,6 @@ export class View extends HTMLElement {
|
||||
goRight() {
|
||||
return this.book.dir === 'rtl' ? this.prev() : this.next()
|
||||
}
|
||||
setAppearance({ layout, css }) {
|
||||
if (this.isFixedLayout) return
|
||||
Object.assign(this.renderer.layout, layout)
|
||||
this.#css = css
|
||||
this.renderer.setStyle(css)
|
||||
this.renderer.render()
|
||||
}
|
||||
async * #searchSection(matcher, query, index) {
|
||||
const doc = await this.book.sections[index].createDocument()
|
||||
for (const { range, excerpt } of matcher(doc, query))
|
||||
|
||||
Reference in New Issue
Block a user