mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-10-24 14:59:51 -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:
1 parent
88ac253f30
commit
967a00f5b8
3 files changed
+39
-34
No files matched your search
@@ -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