Prevent console errors when clicking to change page while in Presentation Mode (issue 8498)

The click handler used in Presentation Mode didn't check if the first/last page was already reached, which after PR 7529 now causes an unnecessary console error.
Hence we should simply use the already existing `_goToPreviousPage`/`_goToNextPage` methods instead, since they do the necessary bounds checking.

Fixes 8498.
This commit is contained in:
Jonas Jenwald 2017-06-07 17:10:45 +02:00
parent edd7d89fe5
commit 3f2d5cfcc3

View File

@ -288,7 +288,12 @@ class PDFPresentationMode {
if (!isInternalLink) { if (!isInternalLink) {
// Unless an internal link was clicked, advance one page. // Unless an internal link was clicked, advance one page.
evt.preventDefault(); evt.preventDefault();
this.pdfViewer.currentPageNumber += (evt.shiftKey ? -1 : 1);
if (evt.shiftKey) {
this._goToPreviousPage();
} else {
this._goToNextPage();
}
} }
} }
} }