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",
|
||||
"es6-promise": "3.0.2",
|
||||
"lie": "3.1.1",
|
||||
"pako": "1.0.5",
|
||||
"pako": "1.0.6",
|
||||
"readable-stream": "2.0.6"
|
||||
},
|
||||
"dependencies": {
|
||||
|
@ -8925,9 +8925,9 @@
|
|||
"integrity": "sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y="
|
||||
},
|
||||
"pako": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/pako/-/pako-1.0.5.tgz",
|
||||
"integrity": "sha1-0iBd/ludqK95fnwWPbTR+E5GALw="
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz",
|
||||
"integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg=="
|
||||
},
|
||||
"readable-stream": {
|
||||
"version": "2.0.6",
|
||||
|
|
|
@ -75,6 +75,9 @@ class Annotations {
|
|||
|
||||
if (hash in this._annotations) {
|
||||
let annotation = this._annotations[hash];
|
||||
if (annotation.type !== type) {
|
||||
return;
|
||||
}
|
||||
|
||||
let views = this.rendition.views();
|
||||
views.each( (view) => {
|
||||
|
|
|
@ -212,25 +212,25 @@ class Spine {
|
|||
first() {
|
||||
let index = 0;
|
||||
|
||||
while (index < this.spineItems.length-1) {
|
||||
do {
|
||||
let next = this.get(index);
|
||||
if (next && next.linear) {
|
||||
return next;
|
||||
}
|
||||
index += 1;
|
||||
}
|
||||
} while (index < this.spineItems.length-1) ;
|
||||
}
|
||||
|
||||
last() {
|
||||
let index = this.spineItems.length-1;
|
||||
|
||||
while (index > 0) {
|
||||
do {
|
||||
let prev = this.get(index);
|
||||
if (prev && prev.linear) {
|
||||
return prev;
|
||||
}
|
||||
index -= 1;
|
||||
}
|
||||
} while (index > 0);
|
||||
}
|
||||
|
||||
destroy() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue