1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-03 14:59:18 +02:00

Fix width to pixel amount, add direction to html if present on body

This commit is contained in:
Fred Chasen 2017-10-31 16:06:38 -07:00
parent 20183379b3
commit a55f8a5741
2 changed files with 11 additions and 8 deletions

View file

@ -70,8 +70,14 @@
if (active) {
active.classList.add("active");
}
let urlParam = params && params.get("url");
let url = '';
if (urlParam) {
url = "url=" + urlParam + "&";
}
// Add CFI fragment to the history
history.pushState({}, '', "?loc=" + encodeURIComponent(section.href));
history.pushState({}, '', "?" + url + "loc=" + encodeURIComponent(section.href));
// window.location.hash = "#/"+section.href
});

View file

@ -779,15 +779,12 @@ class Contents {
var COLUMN_WIDTH = prefixed("column-width");
var COLUMN_FILL = prefixed("column-fill");
var isVertical = this.writingMode().indexOf("vertical") === 0;
if (isVertical) {
this.width(width);
} else {
this.width("100%");
// Fix body width issues if rtl is only set on body element
if (this.content.dir === "rtl") {
this.direction("rtl");
}
// this.width("100%");
this.width(width);
this.height(height);
// Deal with Mobile trying to scale to viewport