Skip to content

Commit

Permalink
Merge pull request mozilla#8535 from Snuffleupagus/app-close-pageRota…
Browse files Browse the repository at this point in the history
…tion-downloadComplete

Reset `pageRotation` and `downloadComplete` in `PDFViewerApplication.close`
  • Loading branch information
timvandermeij authored Jun 17, 2017
2 parents 0eeb987 + 2d100a2 commit c3c9624
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ var PDFViewerApplication = {
l10n: null,
pageRotation: 0,
isInitialViewSet: false,
downloadComplete: false,
viewerPrefs: {
sidebarViewOnLoad: SidebarView.NONE,
pdfBugEnabled: false,
Expand Down Expand Up @@ -600,7 +601,9 @@ var PDFViewerApplication = {
this.pdfDocumentProperties.setDocument(null, null);
}
this.store = null;
this.pageRotation = 0;
this.isInitialViewSet = false;
this.downloadComplete = false;

this.pdfSidebar.reset();
this.pdfOutlineViewer.reset();
Expand Down Expand Up @@ -670,8 +673,6 @@ var PDFViewerApplication = {
}
}

this.downloadComplete = false;

let loadingTask = getDocument(parameters);
this.pdfLoadingTask = loadingTask;

Expand Down Expand Up @@ -912,8 +913,6 @@ var PDFViewerApplication = {
let pagesPromise = pdfViewer.pagesPromise;
let onePageRendered = pdfViewer.onePageRendered;

this.pageRotation = 0;

let pdfThumbnailViewer = this.pdfThumbnailViewer;
pdfThumbnailViewer.setDocument(pdfDocument);

Expand Down Expand Up @@ -1242,8 +1241,11 @@ var PDFViewerApplication = {
this.forceRendering();
},

rotatePages: function pdfViewRotatePages(delta) {
var pageNumber = this.page;
rotatePages(delta) {
if (!this.pdfDocument) {
return;
}
let pageNumber = this.page;
this.pageRotation = (this.pageRotation + 360 + delta) % 360;
this.pdfViewer.pagesRotation = this.pageRotation;
this.pdfThumbnailViewer.pagesRotation = this.pageRotation;
Expand Down

0 comments on commit c3c9624

Please sign in to comment.