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:
John Factotum
2022-10-27 09:05:29 +00:00
committed by GitHub
parent 88ac253f30
commit 967a00f5b8
3 changed files with 39 additions and 34 deletions
-9
View File
@@ -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]'))