mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-02 14:49:16 +02:00
Merge branch 'v0.3' of https://github.com/futurepress/epub.js into v0.3
This commit is contained in:
commit
c9990314b2
1 changed files with 9 additions and 0 deletions
|
@ -81,6 +81,7 @@ class Annotations {
|
|||
|
||||
let views = this.rendition.views();
|
||||
views.each( (view) => {
|
||||
this._removeFromAnnotationBySectionIndex(annotation.sectionIndex, hash);
|
||||
if (annotation.sectionIndex === view.index) {
|
||||
annotation.detach(view);
|
||||
}
|
||||
|
@ -90,6 +91,14 @@ class Annotations {
|
|||
}
|
||||
}
|
||||
|
||||
_removeFromAnnotationBySectionIndex (sectionIndex, hash) {
|
||||
this._annotationsBySectionIndex[sectionIndex] = this._annotationsAt(sectionIndex).filter(h => h !== hash);
|
||||
}
|
||||
|
||||
_annotationsAt (index) {
|
||||
return this._annotationsBySectionIndex[index];
|
||||
}
|
||||
|
||||
highlight (cfiRange, data, cb) {
|
||||
this.add("highlight", cfiRange, data, cb);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue