mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-09 11:29:14 -04:00
Further reduce header and footer styles
Instead, provide classes. Also: prefix all classes with `foliate-`.
This commit is contained in:
+1
-1
@@ -67,7 +67,7 @@ class Container {
|
|||||||
// https://bugs.webkit.org/show_bug.cgi?id=218086
|
// https://bugs.webkit.org/show_bug.cgi?id=218086
|
||||||
iframe.setAttribute('sandbox', 'allow-same-origin allow-scripts')
|
iframe.setAttribute('sandbox', 'allow-same-origin allow-scripts')
|
||||||
iframe.setAttribute('scrolling', 'no')
|
iframe.setAttribute('scrolling', 'no')
|
||||||
iframe.classList.add('filter')
|
iframe.classList.add('foliate-filter')
|
||||||
this.#element.append(element)
|
this.#element.append(element)
|
||||||
if (!src) return { blank: true, element, iframe }
|
if (!src) return { blank: true, element, iframe }
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
|
|||||||
+4
-13
@@ -132,17 +132,6 @@ const makeMarginals = length => Array.from({ length }, () => {
|
|||||||
const div = document.createElement('div')
|
const div = document.createElement('div')
|
||||||
const child = document.createElement('div')
|
const child = document.createElement('div')
|
||||||
div.append(child)
|
div.append(child)
|
||||||
Object.assign(div.style, {
|
|
||||||
display: 'flex',
|
|
||||||
alignItems: 'center',
|
|
||||||
minWidth: '0',
|
|
||||||
})
|
|
||||||
Object.assign(child.style, {
|
|
||||||
flex: '1',
|
|
||||||
overflow: 'hidden',
|
|
||||||
whiteSpace: 'nowrap',
|
|
||||||
textOverflow: 'ellipsis',
|
|
||||||
})
|
|
||||||
return div
|
return div
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -158,7 +147,7 @@ class View {
|
|||||||
#layout = {}
|
#layout = {}
|
||||||
constructor({ container }) {
|
constructor({ container }) {
|
||||||
this.container = container
|
this.container = container
|
||||||
this.#iframe.classList.add('filter')
|
this.#iframe.classList.add('foliate-filter')
|
||||||
this.#element.append(this.#iframe)
|
this.#element.append(this.#iframe)
|
||||||
Object.assign(this.#element.style, {
|
Object.assign(this.#element.style, {
|
||||||
boxSizing: 'content-box',
|
boxSizing: 'content-box',
|
||||||
@@ -378,7 +367,7 @@ export class Paginator {
|
|||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
top: '0', left: '0',
|
top: '0', left: '0',
|
||||||
})
|
})
|
||||||
this.#background.classList.add('filter')
|
this.#background.classList.add('foliate-filter')
|
||||||
|
|
||||||
this.#element.append(this.#maxSizeContainer)
|
this.#element.append(this.#maxSizeContainer)
|
||||||
Object.assign(this.#maxSizeContainer.style, {
|
Object.assign(this.#maxSizeContainer.style, {
|
||||||
@@ -400,6 +389,8 @@ export class Paginator {
|
|||||||
}
|
}
|
||||||
Object.assign(this.#header.style, marginalStyle)
|
Object.assign(this.#header.style, marginalStyle)
|
||||||
Object.assign(this.#footer.style, marginalStyle)
|
Object.assign(this.#footer.style, marginalStyle)
|
||||||
|
this.#header.classList.add('foliate-header')
|
||||||
|
this.#footer.classList.add('foliate-footer')
|
||||||
this.#maxSizeContainer.append(this.#header)
|
this.#maxSizeContainer.append(this.#header)
|
||||||
this.#maxSizeContainer.append(this.#footer)
|
this.#maxSizeContainer.append(this.#footer)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user