Inline the webViewerOpenFileViaURL
function in webViewerInitialized
#14857
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Inline the
webViewerOpenFileViaURL
function inwebViewerInitialized
Given that
webViewerOpenFileViaURL
only has a single call-site, and also isn't a particularly large/complex function, it doesn't seem necessary for this to be a separate function and hence it's simply inlined instead.Also, changes the "no valid build-target was set"-case to throw unconditionally since the only way that it could ever be hit is if there are bugs in the
gulpfile
-code.Only define the
webViewerFileInputChange
/webViewerOpenFile
variables in GENERIC buildsThere'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 thanlet
, 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.