Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify the code that resets the value of the pageNumber element in PDFViewerApplication.setInitialView #6199

Merged
merged 1 commit into from Jul 12, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions web/viewer.js
Expand Up @@ -954,11 +954,10 @@ var PDFViewerApplication = {
setInitialView: function pdfViewSetInitialView(storedHash, scale) {
this.isInitialViewSet = true;

// When opening a new file (when one is already loaded in the viewer):
// Reset 'currentPageNumber', since otherwise the page's scale will be wrong
// if 'currentPageNumber' is larger than the number of pages in the file.
// When opening a new file, when one is already loaded in the viewer,
// ensure that the 'pageNumber' element displays the correct value.
document.getElementById('pageNumber').value =
this.pdfViewer.currentPageNumber = 1;
this.pdfViewer.currentPageNumber;

if (this.initialDestination) {
this.pdfLinkService.navigateTo(this.initialDestination);
Expand Down