mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Re-factor loadAndEnablePDFBug
and PDFBug.init
The `loadAndEnablePDFBug` helper function, in `web/app.js`, can be simplified a little bit by making it `async`. Furthermore, given how `PDFBug` is being used, we can also (slightly) re-factor `PDFBug.init` such that the `PDFBug.enable`-call is done internally rather than having to handle that manually at the call-site. (Finally, utilize `await` more in the `loadFakeWorker` helper function.)
This commit is contained in:
parent
a936509b77
commit
bc8787b049
2 changed files with 11 additions and 16 deletions
|
@ -540,7 +540,8 @@ window.PDFBug = (function PDFBugClosure() {
|
|||
});
|
||||
}
|
||||
},
|
||||
init(pdfjsLib, container) {
|
||||
init(pdfjsLib, container, ids) {
|
||||
this.enable(ids);
|
||||
/*
|
||||
* Basic Layout:
|
||||
* PDFBug
|
||||
|
@ -589,12 +590,8 @@ window.PDFBug = (function PDFBugClosure() {
|
|||
tool.init(pdfjsLib);
|
||||
} else {
|
||||
panel.textContent =
|
||||
tool.name +
|
||||
" is disabled. To enable add " +
|
||||
' "' +
|
||||
tool.id +
|
||||
'" to the pdfBug parameter ' +
|
||||
"and refresh (separate multiple by commas).";
|
||||
`${tool.name} is disabled. To enable add "${tool.id}" to ` +
|
||||
"the pdfBug parameter and refresh (separate multiple by commas).";
|
||||
}
|
||||
buttons.push(panelButton);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue