mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Slightly simplify the parameter handling in initPassiveLoading.onOpenWithURL
This commit is contained in:
parent
b375a867eb
commit
25b581c2a9
1 changed files with 3 additions and 8 deletions
11
web/app.js
11
web/app.js
|
@ -709,14 +709,9 @@ const PDFViewerApplication = {
|
|||
this.open(data);
|
||||
},
|
||||
onOpenWithURL: (url, length, originalUrl) => {
|
||||
let file = url,
|
||||
args = null;
|
||||
if (length !== undefined) {
|
||||
args = { length };
|
||||
}
|
||||
if (originalUrl !== undefined) {
|
||||
file = { url, originalUrl };
|
||||
}
|
||||
const file = originalUrl !== undefined ? { url, originalUrl } : url;
|
||||
const args = length !== undefined ? { length } : null;
|
||||
|
||||
this.open(file, args);
|
||||
},
|
||||
onError: err => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue