mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-09 11:29:14 -04:00
Make paginator more self-contained
Don't rely on absolute positioning and margin. And set background on the containing element rather than the document body.
This commit is contained in:
@@ -174,15 +174,6 @@ export class View {
|
||||
|
||||
this.renderer.setStyle(this.#css)
|
||||
|
||||
// set `document` background to `doc` background
|
||||
// this is needed cause the iframe does not fill the whole viewport
|
||||
const bodyStyle = doc.defaultView.getComputedStyle(doc.body)
|
||||
document.body.style.background =
|
||||
bodyStyle.backgroundColor === 'rgba(0, 0, 0, 0)'
|
||||
&& bodyStyle.backgroundImage === 'none'
|
||||
? doc.defaultView.getComputedStyle(doc.documentElement).background
|
||||
: bodyStyle.background
|
||||
|
||||
// set handlers for links
|
||||
const section = book.sections[index]
|
||||
for (const a of doc.querySelectorAll('a[href]'))
|
||||
|
||||
Reference in New Issue
Block a user