diff --git a/package-lock.json b/package-lock.json index f72ed2d..dac41df 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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", diff --git a/src/annotations.js b/src/annotations.js index 224e3e7..8193ed9 100644 --- a/src/annotations.js +++ b/src/annotations.js @@ -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) => { diff --git a/src/spine.js b/src/spine.js index 6f7291a..028e959 100644 --- a/src/spine.js +++ b/src/spine.js @@ -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() {