1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-05 15:32:55 +02:00

Fix for column rendering in Safari (#614)

* Fix for column rendering in Safari

* Set body to display inline in Columns css
This commit is contained in:
Fred Chasen 2017-05-09 16:42:30 -04:00 committed by GitHub
parent 042793157b
commit 2d3f1cc039
5 changed files with 51 additions and 33 deletions

View file

@ -18,9 +18,12 @@
<a id="next" href="#next" class="arrow"></a>
<script>
var currentSectionIndex = 0;
var params = new URLSearchParams(document.location.search.substring(1));
var url = params && params.get("url") && decodeURIComponent(params.get("url"));
var currentSectionIndex = (params && params.get("loc")) ? params.get("loc") : 0;
// Load the opf
var book = ePub("https://s3.amazonaws.com/moby-dick/moby-dick.epub");
var book = ePub(url || "https://s3.amazonaws.com/moby-dick/moby-dick.epub");
var rendition = book.renderTo("viewer", {
width: "100%",
height: 600
@ -64,7 +67,8 @@
rendition.on("rendered", function(section){
var nextSection = section.next();
var prevSection = section.prev();
var current = book.navigation.get(section.href);
var current = book.navigation && book.navigation.get(section.href);
if (current) {
title.textContent = current.label;