Skip to content

Commit

Permalink
Merge pull request #89 from d-i-t-a/develop
Browse files Browse the repository at this point in the history
1.3.2
  • Loading branch information
aferditamuriqi authored Nov 3, 2020
2 parents e03c841 + 5fc5eef commit 3960c28
Show file tree
Hide file tree
Showing 6 changed files with 175 additions and 40 deletions.
129 changes: 123 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@d-i-t-a/reader",
"version": "1.3.1",
"version": "1.3.2",
"description": "A viewer application for EPUB files.",
"repository": "https://github.com/d-i-t-a/R2D2BC",
"license": "Apache-2.0",
Expand All @@ -27,6 +27,7 @@
"debounce": "^1.2.0",
"mark.js": "^8.11.1",
"promise-polyfill": "^8.1.3",
"sanitize-html": "^2.1.1",
"ts-optchain": "^0.1.8",
"whatwg-fetch": "^2.0.4"
},
Expand Down
4 changes: 3 additions & 1 deletion src/modules/AnnotationModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export default class AnnotationModule implements ReaderModule {
}

initialAnnotationColor?: string
private hasEventListener: boolean = false

initialize(initialAnnotationColor?:string) {
this.initialAnnotationColor = initialAnnotationColor
Expand All @@ -126,7 +127,7 @@ export default class AnnotationModule implements ReaderModule {
if (this.rights.enableAnnotations) {
const body = HTMLUtilities.findRequiredIframeElement(this.delegate.iframe.contentDocument, "body") as HTMLBodyElement;
var self = this
this.highlighter = new TextHighlighter(this, body, this.selectionMenuItems, {
this.highlighter = new TextHighlighter(this, body, this.selectionMenuItems, this.hasEventListener, {
onBeforeHighlight: function (selectionInfo: any) {
if (IS_DEV) {
console.log("onBeforeHighlight")
Expand All @@ -138,6 +139,7 @@ export default class AnnotationModule implements ReaderModule {
await self.saveAnnotation(highlight, marker)
}
});
this.hasEventListener = true
setTimeout(() => {
this.drawHighlights()
}, 300);
Expand Down
Loading

0 comments on commit 3960c28

Please sign in to comment.