mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
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
1 changed files with 4 additions and 3 deletions
|
@ -2424,9 +2424,9 @@ function webViewerHashchange(evt) {
|
|||
}
|
||||
}
|
||||
|
||||
let webViewerFileInputChange, webViewerOpenFile;
|
||||
if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
||||
webViewerFileInputChange = function (evt) {
|
||||
// eslint-disable-next-line no-var
|
||||
var webViewerFileInputChange = function (evt) {
|
||||
if (PDFViewerApplication.pdfViewer?.isInPresentationMode) {
|
||||
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);
|
||||
};
|
||||
|
||||
webViewerOpenFile = function (evt) {
|
||||
// eslint-disable-next-line no-var
|
||||
var webViewerOpenFile = function (evt) {
|
||||
const fileInput = PDFViewerApplication.appConfig.openFileInput;
|
||||
fileInput.click();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue