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

Fixed for firefox

This commit is contained in:
Fred Chasen 2014-09-04 13:45:49 -04:00
parent 1fdbf609f5
commit 951d6ff3e2
5 changed files with 29 additions and 11 deletions

18
dist/epub.js vendored
View file

@ -6859,11 +6859,19 @@ EPUBJS.Section.prototype.load = function(_request){
EPUBJS.Section.prototype.replacements = function(_document){
var task = new RSVP.defer();
var base = _document.createElement("base"); // TODO: check if exists
var head;
base.setAttribute("href", this.url);
_document.head.insertBefore(base, _document.head.firstChild);
if(_document) {
head = _document.querySelector("head");
}
if(head) {
head.insertBefore(base, head.firstChild);
task.resolve();
} else {
task.reject(new Error("No head to insert into"));
}
task.resolve();
return task.promise;
};
@ -7001,8 +7009,8 @@ EPUBJS.View.prototype.create = function() {
this.iframe.style.border = "none";
this.resizing = true;
this.iframe.style.width = "100%";
this.iframe.style.height = "100%";
// this.iframe.style.width = "100%";
// this.iframe.style.height = "100%";
this.iframe.style.display = "none";
this.iframe.style.visibility = "hidden";

2
dist/epub.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -12,6 +12,8 @@
background: #fafafa;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #333;
height: 100%;
position: absolute;
}
#viewer {

View file

@ -47,11 +47,19 @@ EPUBJS.Section.prototype.load = function(_request){
EPUBJS.Section.prototype.replacements = function(_document){
var task = new RSVP.defer();
var base = _document.createElement("base"); // TODO: check if exists
var head;
base.setAttribute("href", this.url);
_document.head.insertBefore(base, _document.head.firstChild);
if(_document) {
head = _document.querySelector("head");
}
if(head) {
head.insertBefore(base, head.firstChild);
task.resolve();
} else {
task.reject(new Error("No head to insert into"));
}
task.resolve();
return task.promise;
};

View file

@ -15,8 +15,8 @@ EPUBJS.View.prototype.create = function() {
this.iframe.style.border = "none";
this.resizing = true;
this.iframe.style.width = "100%";
this.iframe.style.height = "100%";
// this.iframe.style.width = "100%";
// this.iframe.style.height = "100%";
this.iframe.style.display = "none";
this.iframe.style.visibility = "hidden";