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

Added ePub() function, book.destroy, moved reader dev to demo folder

This commit is contained in:
Fred Chasen 2013-07-20 12:49:44 -07:00
parent 53955612ca
commit 660d570c02
28 changed files with 236 additions and 90 deletions

View file

@ -4,9 +4,11 @@ EPUBJS.Hooks.register("beforeChapterDisplay").endnotes = function(callback, chap
items = Array.prototype.slice.call(notes), //[].slice.call()
attr = "epub:type",
type = "noteref",
folder = EPUBJS.core.folder(location.pathname),
cssPath = folder + EPUBJS.cssPath || folder,
popups = {};
EPUBJS.core.addCss("../demo/css/popup.css", false, chapter.doc.head);
EPUBJS.core.addCss(cssPath + "popup.css", false, chapter.doc.head);
items.forEach(function(item){
@ -157,7 +159,7 @@ EPUBJS.Hooks.register("beforeChapterDisplay").endnotes = function(callback, chap
EPUBJS.Hooks.register("beforeChapterDisplay").smartimages = function(callback, chapter){
var images = chapter.doc.querySelectorAll('img'),
items = Array.prototype.slice.call(images),
iheight = chapter.height(),//chapter.doc.body.getBoundingClientRect().height,
iheight = chapter.bodyEl.clientHeight,//chapter.doc.body.getBoundingClientRect().height,
oheight;
items.forEach(function(item){
@ -170,7 +172,7 @@ EPUBJS.Hooks.register("beforeChapterDisplay").smartimages = function(callback, c
height = oHeight || rectHeight,
newHeight;
iheight = chapter.height();
iheight = chapter.bodyEl.clientHeight;
if(top < 0) top = 0;
if(height + top >= iheight) {