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:
parent
1fdbf609f5
commit
951d6ff3e2
5 changed files with 29 additions and 11 deletions
18
dist/epub.js
vendored
18
dist/epub.js
vendored
|
@ -6859,11 +6859,19 @@ EPUBJS.Section.prototype.load = function(_request){
|
||||||
EPUBJS.Section.prototype.replacements = function(_document){
|
EPUBJS.Section.prototype.replacements = function(_document){
|
||||||
var task = new RSVP.defer();
|
var task = new RSVP.defer();
|
||||||
var base = _document.createElement("base"); // TODO: check if exists
|
var base = _document.createElement("base"); // TODO: check if exists
|
||||||
|
var head;
|
||||||
base.setAttribute("href", this.url);
|
base.setAttribute("href", this.url);
|
||||||
_document.head.insertBefore(base, _document.head.firstChild);
|
|
||||||
|
|
||||||
task.resolve();
|
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"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return task.promise;
|
return task.promise;
|
||||||
};
|
};
|
||||||
|
@ -7001,8 +7009,8 @@ EPUBJS.View.prototype.create = function() {
|
||||||
this.iframe.style.border = "none";
|
this.iframe.style.border = "none";
|
||||||
|
|
||||||
this.resizing = true;
|
this.resizing = true;
|
||||||
this.iframe.style.width = "100%";
|
// this.iframe.style.width = "100%";
|
||||||
this.iframe.style.height = "100%";
|
// this.iframe.style.height = "100%";
|
||||||
|
|
||||||
this.iframe.style.display = "none";
|
this.iframe.style.display = "none";
|
||||||
this.iframe.style.visibility = "hidden";
|
this.iframe.style.visibility = "hidden";
|
||||||
|
|
2
dist/epub.min.js
vendored
2
dist/epub.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -12,6 +12,8 @@
|
||||||
background: #fafafa;
|
background: #fafafa;
|
||||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
color: #333;
|
color: #333;
|
||||||
|
height: 100%;
|
||||||
|
position: absolute;
|
||||||
}
|
}
|
||||||
|
|
||||||
#viewer {
|
#viewer {
|
||||||
|
|
|
@ -47,11 +47,19 @@ EPUBJS.Section.prototype.load = function(_request){
|
||||||
EPUBJS.Section.prototype.replacements = function(_document){
|
EPUBJS.Section.prototype.replacements = function(_document){
|
||||||
var task = new RSVP.defer();
|
var task = new RSVP.defer();
|
||||||
var base = _document.createElement("base"); // TODO: check if exists
|
var base = _document.createElement("base"); // TODO: check if exists
|
||||||
|
var head;
|
||||||
base.setAttribute("href", this.url);
|
base.setAttribute("href", this.url);
|
||||||
_document.head.insertBefore(base, _document.head.firstChild);
|
|
||||||
|
|
||||||
task.resolve();
|
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"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return task.promise;
|
return task.promise;
|
||||||
};
|
};
|
||||||
|
|
|
@ -15,8 +15,8 @@ EPUBJS.View.prototype.create = function() {
|
||||||
this.iframe.style.border = "none";
|
this.iframe.style.border = "none";
|
||||||
|
|
||||||
this.resizing = true;
|
this.resizing = true;
|
||||||
this.iframe.style.width = "100%";
|
// this.iframe.style.width = "100%";
|
||||||
this.iframe.style.height = "100%";
|
// this.iframe.style.height = "100%";
|
||||||
|
|
||||||
this.iframe.style.display = "none";
|
this.iframe.style.display = "none";
|
||||||
this.iframe.style.visibility = "hidden";
|
this.iframe.style.visibility = "hidden";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue