mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-03 14:59:18 +02:00
Fix min image size, locationOf no longer uses scrollX / Y
This commit is contained in:
parent
661d4d77d1
commit
aa9c2535d9
3 changed files with 5 additions and 5 deletions
|
@ -188,7 +188,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Load the opf
|
// Load the opf
|
||||||
var book = ePub("https://s3.amazonaws.com/epubjs/books/alice/OPS/package.opf");
|
var book = ePub(window.location.protocol + "//s3.amazonaws.com/epubjs/books/alice/OPS/package.opf");
|
||||||
var rendition = book.renderTo("viewer", {
|
var rendition = book.renderTo("viewer", {
|
||||||
flow: "scrolled-doc",
|
flow: "scrolled-doc",
|
||||||
ignoreClass: "annotator-hl"
|
ignoreClass: "annotator-hl"
|
||||||
|
|
|
@ -545,8 +545,8 @@ class IframeView {
|
||||||
var targetPos = this.contents.locationOf(target, this.settings.ignoreClass);
|
var targetPos = this.contents.locationOf(target, this.settings.ignoreClass);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"left": window.scrollX + targetPos.left,
|
"left": targetPos.left,
|
||||||
"top": window.scrollY + targetPos.top
|
"top": targetPos.top
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -643,8 +643,8 @@ class Rendition {
|
||||||
|
|
||||||
contents.addStylesheetRules({
|
contents.addStylesheetRules({
|
||||||
"img" : {
|
"img" : {
|
||||||
"max-width": (this._layout.columnWidth) + "px !important",
|
"max-width": (this._layout.columnWidth ? this._layout.columnWidth + "px" : "100%") + "!important",
|
||||||
"max-height": (this._layout.height) + "px !important",
|
"max-height": (this._layout.height ? this._layout.height + "px" : "50%") + "!important",
|
||||||
"object-fit": "contain",
|
"object-fit": "contain",
|
||||||
"page-break-inside": "avoid"
|
"page-break-inside": "avoid"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue