From 53b89dd844d2d0b597694e8f286f6bd19c41b35e Mon Sep 17 00:00:00 2001 From: Bruno Date: Mon, 25 Sep 2017 17:25:42 +0200 Subject: [PATCH 1/2] Take annotation type in consideration to delete it. --- src/annotations.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/annotations.js b/src/annotations.js index 43ce376..6d3c006 100644 --- a/src/annotations.js +++ b/src/annotations.js @@ -74,7 +74,9 @@ class Annotations { if (hash in this._annotations) { let annotation = this._annotations[hash]; - + if (annotation.type !== type) { + return; + } let contents = this.rendition.getContents(); contents.forEach( (content) => { if (annotation.sectionIndex === content.sectionIndex) { From ce8dc1e4ba1baf2c7d6bcd3342ed1597c65b1cae Mon Sep 17 00:00:00 2001 From: Anatoly Smolyaninov Date: Tue, 26 Sep 2017 20:56:07 +0700 Subject: [PATCH 2/2] Fix last\first spine methods --- src/spine.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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() {