mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-03 14:59:18 +02:00
Merged Annotations fixes
This commit is contained in:
commit
966611edc8
3 changed files with 11 additions and 8 deletions
8
package-lock.json
generated
8
package-lock.json
generated
|
@ -8910,7 +8910,7 @@
|
||||||
"core-js": "2.3.0",
|
"core-js": "2.3.0",
|
||||||
"es6-promise": "3.0.2",
|
"es6-promise": "3.0.2",
|
||||||
"lie": "3.1.1",
|
"lie": "3.1.1",
|
||||||
"pako": "1.0.5",
|
"pako": "1.0.6",
|
||||||
"readable-stream": "2.0.6"
|
"readable-stream": "2.0.6"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -8925,9 +8925,9 @@
|
||||||
"integrity": "sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y="
|
"integrity": "sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y="
|
||||||
},
|
},
|
||||||
"pako": {
|
"pako": {
|
||||||
"version": "1.0.5",
|
"version": "1.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/pako/-/pako-1.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz",
|
||||||
"integrity": "sha1-0iBd/ludqK95fnwWPbTR+E5GALw="
|
"integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg=="
|
||||||
},
|
},
|
||||||
"readable-stream": {
|
"readable-stream": {
|
||||||
"version": "2.0.6",
|
"version": "2.0.6",
|
||||||
|
|
|
@ -75,6 +75,9 @@ class Annotations {
|
||||||
|
|
||||||
if (hash in this._annotations) {
|
if (hash in this._annotations) {
|
||||||
let annotation = this._annotations[hash];
|
let annotation = this._annotations[hash];
|
||||||
|
if (annotation.type !== type) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let views = this.rendition.views();
|
let views = this.rendition.views();
|
||||||
views.each( (view) => {
|
views.each( (view) => {
|
||||||
|
|
|
@ -212,25 +212,25 @@ class Spine {
|
||||||
first() {
|
first() {
|
||||||
let index = 0;
|
let index = 0;
|
||||||
|
|
||||||
while (index < this.spineItems.length-1) {
|
do {
|
||||||
let next = this.get(index);
|
let next = this.get(index);
|
||||||
if (next && next.linear) {
|
if (next && next.linear) {
|
||||||
return next;
|
return next;
|
||||||
}
|
}
|
||||||
index += 1;
|
index += 1;
|
||||||
}
|
} while (index < this.spineItems.length-1) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
last() {
|
last() {
|
||||||
let index = this.spineItems.length-1;
|
let index = this.spineItems.length-1;
|
||||||
|
|
||||||
while (index > 0) {
|
do {
|
||||||
let prev = this.get(index);
|
let prev = this.get(index);
|
||||||
if (prev && prev.linear) {
|
if (prev && prev.linear) {
|
||||||
return prev;
|
return prev;
|
||||||
}
|
}
|
||||||
index -= 1;
|
index -= 1;
|
||||||
}
|
} while (index > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
destroy() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue