mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-04 15:09:16 +02:00
Remote hypothes.is example, ncx fixes
This commit is contained in:
parent
1b4154c457
commit
c536829ea9
20 changed files with 584 additions and 313 deletions
|
@ -23,6 +23,7 @@ Contents.prototype.width = function(w) {
|
|||
|
||||
if (w) {
|
||||
this.documentElement.style.width = w;
|
||||
this.content.style.width = w;
|
||||
}
|
||||
|
||||
return this.window.getComputedStyle(this.documentElement)['width'];
|
||||
|
@ -38,6 +39,7 @@ Contents.prototype.height = function(h) {
|
|||
|
||||
if (h) {
|
||||
this.documentElement.style.height = h;
|
||||
this.content.style.height = h;
|
||||
}
|
||||
|
||||
return this.window.getComputedStyle(this.documentElement)['height'];
|
||||
|
@ -83,7 +85,7 @@ Contents.prototype.scrollHeight = function() {
|
|||
|
||||
Contents.prototype.overflow = function(overflow) {
|
||||
|
||||
if (h) {
|
||||
if (overflow) {
|
||||
this.documentElement.style.overflow = overflow;
|
||||
}
|
||||
|
||||
|
@ -246,8 +248,13 @@ Contents.prototype.locationOf = function(target, ignoreClass) {
|
|||
|
||||
if(this.epubcfi.isCfiString(target)) {
|
||||
range = new EpubCFI(cfi).toRange(this.document, ignoreClass);
|
||||
|
||||
if(range) {
|
||||
targetPos = range.getBoundingClientRect();
|
||||
if (range.startContainer.nodeType === Node.ELEMENT_NODE) {
|
||||
targetPos = range.startContainer.getBoundingClientRect();
|
||||
} else {
|
||||
targetPos = range.getBoundingClientRect();
|
||||
}
|
||||
}
|
||||
|
||||
} else if(typeof target === "string" &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue