mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 18:25:37 +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);
|
this.open(data);
|
||||||
},
|
},
|
||||||
onOpenWithURL: (url, length, originalUrl) => {
|
onOpenWithURL: (url, length, originalUrl) => {
|
||||||
let file = url,
|
const file = originalUrl !== undefined ? { url, originalUrl } : url;
|
||||||
args = null;
|
const args = length !== undefined ? { length } : null;
|
||||||
if (length !== undefined) {
|
|
||||||
args = { length };
|
|
||||||
}
|
|
||||||
if (originalUrl !== undefined) {
|
|
||||||
file = { url, originalUrl };
|
|
||||||
}
|
|
||||||
this.open(file, args);
|
this.open(file, args);
|
||||||
},
|
},
|
||||||
onError: err => {
|
onError: err => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue