Merge pull request #5488 from Snuffleupagus/presentationMode-no-zoom-followup

Prevent a "TypeError: pdfViewer is null" when the viewer loads (PR 5413 followup)
This commit is contained in:
Tim van der Meij 2014-11-18 20:01:59 +01:00
commit 23bcab6f88

View File

@ -2024,9 +2024,9 @@ window.addEventListener('keydown', function keydown(evt) {
if (cmd === 1 || cmd === 8 || cmd === 5 || cmd === 12) {
// either CTRL or META key with optional SHIFT.
var pdfViewer = PDFViewerApplication.pdfViewer;
var inPresentationMode =
pdfViewer.presentationModeState === PresentationModeState.CHANGING ||
pdfViewer.presentationModeState === PresentationModeState.FULLSCREEN;
var inPresentationMode = pdfViewer &&
(pdfViewer.presentationModeState === PresentationModeState.CHANGING ||
pdfViewer.presentationModeState === PresentationModeState.FULLSCREEN);
switch (evt.keyCode) {
case 70: // f