Update PDFOutlineViewer_bindLink to look more like LinkAnnotationElement_bindLink

This commit is contained in:
Jonas Jenwald 2016-10-22 17:44:17 +02:00
parent 47a1c7797e
commit d5e3b2fbf0
2 changed files with 8 additions and 5 deletions

View File

@ -299,7 +299,7 @@ var LinkAnnotationElement = (function LinkAnnotationElementClosure() {
if (this.data.action) {
this._bindNamedAction(link, this.data.action);
} else {
this._bindLink(link, (this.data.dest || null));
this._bindLink(link, this.data.dest);
}
}

View File

@ -90,10 +90,13 @@ var PDFOutlineViewer = (function PDFOutlineViewerClosure() {
});
return;
}
var linkService = this.linkService;
element.href = linkService.getDestinationHash(item.dest);
element.onclick = function goToDestination(e) {
linkService.navigateTo(item.dest);
var self = this, destination = item.dest;
element.href = self.linkService.getDestinationHash(destination);
element.onclick = function () {
if (destination) {
self.linkService.navigateTo(destination);
}
return false;
};
},