Skip to content

Commit

Permalink
Add type to unhighlight calls
Browse files Browse the repository at this point in the history
  • Loading branch information
fchasen committed Sep 6, 2019
1 parent 35955ac commit 68c3f3a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
3 changes: 2 additions & 1 deletion EpubReader/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,9 @@ class EpubReader extends Component {
// Add marker
rendition.highlight(cfiRange, {});
}}
onMarkClicked={(cfiRange) => {
onMarkClicked={(cfiRange, data, rendition) => {
console.log("mark clicked", cfiRange)
rendition.unhighlight(cfiRange);
}}
// themes={{
// tan: {
Expand Down
6 changes: 3 additions & 3 deletions EpubReader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"move": "mv epubjs-rn-*.tgz epubjs-rn.r16.tgz",
"move": "mv epubjs-rn-*.tgz epubjs-rn.r17.tgz",
"preinstall": "npm pack ../ && npm run move",
"postinstall": "rm epubjs-rn.r16.tgz"
"postinstall": "rm epubjs-rn.r17.tgz"
},
"dependencies": {
"@react-native-community/slider": "^1.1.4",
"epubjs-rn": "file:./epubjs-rn.r16.tgz",
"epubjs-rn": "file:./epubjs-rn.r17.tgz",
"react": "16.8.3",
"react-native": "0.59.9",
"react-native-vector-icons": "^6.6.0"
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

12 changes: 6 additions & 6 deletions src/Rendition.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,16 +243,16 @@ class Rendition extends Component {
this.sendToBridge("mark", [cfiRange, data]);
}

unhighlight (cfiRange, data) {
this.sendToBridge("removeAnnotation", [cfiRange, data]);
unhighlight (cfiRange) {
this.sendToBridge("removeAnnotation", [cfiRange, "highlight"]);
}

ununderline (cfiRange, data) {
this.sendToBridge("removeAnnotation", [cfiRange, data]);
ununderline (cfiRange) {
this.sendToBridge("removeAnnotation", [cfiRange, "underline"]);
}

unmark (cfiRange, data) {
this.sendToBridge("removeAnnotation", [cfiRange, data]);
unmark (cfiRange) {
this.sendToBridge("removeAnnotation", [cfiRange, "mark"]);
}

next() {
Expand Down

0 comments on commit 68c3f3a

Please sign in to comment.