Only define the webViewerFileInputChange
/webViewerOpenFile
variables in GENERIC builds
There's no point in having these variables defined (implicitly) as `undefined` in e.g. the Firefox PDF Viewer. By defining them with `var` and using ESList ignores, rather than `let`, we can move them into the relevant pre-processor block instead. Note that since the entire viewer-code is placed, by Webpack, in a top-level closure these variables will thus *not* become globally accessible.
This commit is contained in:
parent
7cce41c26d
commit
9268924a15
@ -2424,9 +2424,9 @@ function webViewerHashchange(evt) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let webViewerFileInputChange, webViewerOpenFile;
|
|
||||||
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
||||||
webViewerFileInputChange = function (evt) {
|
// eslint-disable-next-line no-var
|
||||||
|
var webViewerFileInputChange = function (evt) {
|
||||||
if (PDFViewerApplication.pdfViewer?.isInPresentationMode) {
|
if (PDFViewerApplication.pdfViewer?.isInPresentationMode) {
|
||||||
return; // Opening a new PDF file isn't supported in Presentation Mode.
|
return; // Opening a new PDF file isn't supported in Presentation Mode.
|
||||||
}
|
}
|
||||||
@ -2439,7 +2439,8 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
|||||||
PDFViewerApplication.open(url);
|
PDFViewerApplication.open(url);
|
||||||
};
|
};
|
||||||
|
|
||||||
webViewerOpenFile = function (evt) {
|
// eslint-disable-next-line no-var
|
||||||
|
var webViewerOpenFile = function (evt) {
|
||||||
const fileInput = PDFViewerApplication.appConfig.openFileInput;
|
const fileInput = PDFViewerApplication.appConfig.openFileInput;
|
||||||
fileInput.click();
|
fileInput.click();
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user