1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Re-name and re-factor the PDFLinkService.navigateTo method

This modernizes and improves the code, by using `async`/`await` and by extracting the helper function to its own method.
To hopefully avoid confusion, given the next patch, the method is also re-named to `goToDestination` to make is slightly clearer what it actually does.
This commit is contained in:
Jonas Jenwald 2020-10-03 17:43:33 +02:00
parent 4b4ac8a13d
commit 8431cfe482
5 changed files with 94 additions and 84 deletions

View file

@ -344,7 +344,7 @@ class LinkAnnotationElement extends AnnotationElement {
link.href = this.linkService.getDestinationHash(destination);
link.onclick = () => {
if (destination) {
this.linkService.navigateTo(destination);
this.linkService.goToDestination(destination);
}
return false;
};