mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
Convert a number of import * as pdfjsLib from 'pdfjs-web/pdfjs';
cases to only specify the necessary imports
Rather than always importing everything from the `web/pdfjs.js`, similar to all other imports we can just choose what we actually need.
This commit is contained in:
parent
3b35c15d42
commit
b2c3f8f081
14 changed files with 89 additions and 86 deletions
|
@ -13,9 +13,9 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import * as pdfjsLib from 'pdfjs-web/pdfjs';
|
||||
|
||||
var PDFJS = pdfjsLib.PDFJS;
|
||||
import {
|
||||
addLinkAttributes, PDFJS, removeNullCharacters
|
||||
} from 'pdfjs-web/pdfjs';
|
||||
|
||||
var DEFAULT_TITLE = '\u2013';
|
||||
|
||||
|
@ -74,7 +74,7 @@ var PDFOutlineViewer = (function PDFOutlineViewerClosure() {
|
|||
*/
|
||||
_bindLink: function PDFOutlineViewer_bindLink(element, item) {
|
||||
if (item.url) {
|
||||
pdfjsLib.addLinkAttributes(element, {
|
||||
addLinkAttributes(element, {
|
||||
url: item.url,
|
||||
target: (item.newWindow ? PDFJS.LinkTarget.BLANK : undefined),
|
||||
});
|
||||
|
@ -189,7 +189,7 @@ var PDFOutlineViewer = (function PDFOutlineViewerClosure() {
|
|||
this._bindLink(element, item);
|
||||
this._setStyles(element, item);
|
||||
element.textContent =
|
||||
pdfjsLib.removeNullCharacters(item.title) || DEFAULT_TITLE;
|
||||
removeNullCharacters(item.title) || DEFAULT_TITLE;
|
||||
|
||||
div.appendChild(element);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue