mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
Move parsing of destination dictionaries to a helper function
This not only reduces code duplication, but it also allow us to easily support the same kind of URLs we currently do for Link annotations in the Outline as well.
This commit is contained in:
parent
6906623462
commit
e64bc1fd13
4 changed files with 126 additions and 117 deletions
|
@ -26,6 +26,8 @@
|
|||
}
|
||||
}(this, function (exports, pdfjsLib) {
|
||||
|
||||
var PDFJS = pdfjsLib.PDFJS;
|
||||
|
||||
var DEFAULT_TITLE = '\u2013';
|
||||
|
||||
/**
|
||||
|
@ -82,7 +84,10 @@ var PDFOutlineViewer = (function PDFOutlineViewerClosure() {
|
|||
*/
|
||||
_bindLink: function PDFOutlineViewer_bindLink(element, item) {
|
||||
if (item.url) {
|
||||
pdfjsLib.addLinkAttributes(element, { url: item.url });
|
||||
pdfjsLib.addLinkAttributes(element, {
|
||||
url: item.url,
|
||||
target: (item.newWindow ? PDFJS.LinkTarget.BLANK : undefined),
|
||||
});
|
||||
return;
|
||||
}
|
||||
var linkService = this.linkService;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue