Simplify the code that resets the value of the pageNumber
element in PDFViewerApplication.setInitialView
After the creation of `PDFViewer`, its `_resetView` method takes care of resetting, among other things, the page number property. Hence we don't need to set `pdfViewer.currentPageNumber = 1;` here any more, and the comment is no longer accurate either.
This commit is contained in:
parent
535b7c236e
commit
2608757620
@ -954,11 +954,10 @@ var PDFViewerApplication = {
|
|||||||
setInitialView: function pdfViewSetInitialView(storedHash, scale) {
|
setInitialView: function pdfViewSetInitialView(storedHash, scale) {
|
||||||
this.isInitialViewSet = true;
|
this.isInitialViewSet = true;
|
||||||
|
|
||||||
// When opening a new file (when one is already loaded in the viewer):
|
// When opening a new file, when one is already loaded in the viewer,
|
||||||
// Reset 'currentPageNumber', since otherwise the page's scale will be wrong
|
// ensure that the 'pageNumber' element displays the correct value.
|
||||||
// if 'currentPageNumber' is larger than the number of pages in the file.
|
|
||||||
document.getElementById('pageNumber').value =
|
document.getElementById('pageNumber').value =
|
||||||
this.pdfViewer.currentPageNumber = 1;
|
this.pdfViewer.currentPageNumber;
|
||||||
|
|
||||||
if (this.initialDestination) {
|
if (this.initialDestination) {
|
||||||
this.pdfLinkService.navigateTo(this.initialDestination);
|
this.pdfLinkService.navigateTo(this.initialDestination);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user