From 19f6facc1e22b5b4666b17b111ca481d8d882348 Mon Sep 17 00:00:00 2001
From: Jonas Jenwald <jonas.jenwald@gmail.com>
Date: Thu, 11 Jul 2019 15:35:05 +0200
Subject: [PATCH] Ensure that `PDFViewerApplication.{zoomIn, zoomOut}` won't
 run when PresentationMode is active (PR 10652 follow-up)

Similar to the `zoomReset` method we need to ensure that this code won't run for zoom events originating within the browser UI itself, since checks in e.g. the `keydown` event handler won't help in that case.
---
 web/app.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/web/app.js b/web/app.js
index 3b0aecd3e..fd42d2bfa 100644
--- a/web/app.js
+++ b/web/app.js
@@ -412,6 +412,9 @@ let PDFViewerApplication = {
   },
 
   zoomIn(ticks) {
+    if (this.pdfViewer.isInPresentationMode) {
+      return;
+    }
     let newScale = this.pdfViewer.currentScale;
     do {
       newScale = (newScale * DEFAULT_SCALE_DELTA).toFixed(2);
@@ -422,6 +425,9 @@ let PDFViewerApplication = {
   },
 
   zoomOut(ticks) {
+    if (this.pdfViewer.isInPresentationMode) {
+      return;
+    }
     let newScale = this.pdfViewer.currentScale;
     do {
       newScale = (newScale / DEFAULT_SCALE_DELTA).toFixed(2);