Merge pull request #9796 from Snuffleupagus/disable-webViewerFileInputChange-PresentationMode

Disable (drag-and-drop) file opening if Presentation Mode is active (PR 9794 follow-up)
This commit is contained in:
Tim van der Meij 2018-06-12 00:14:42 +02:00 committed by GitHub
commit 2030d1718f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1925,6 +1925,10 @@ function webViewerHashchange(evt) {
let webViewerFileInputChange;
if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) {
webViewerFileInputChange = function webViewerFileInputChange(evt) {
if (PDFViewerApplication.pdfViewer &&
PDFViewerApplication.pdfViewer.isInPresentationMode) {
return; // Opening a new PDF file isn't supported in Presentation Mode.
}
let file = evt.fileInput.files[0];
if (URL.createObjectURL && !AppOptions.get('disableCreateObjectURL')) {