Skip to content

Commit

Permalink
Merge pull request mozilla#8636 from Snuffleupagus/es6-PDFViewer-class
Browse files Browse the repository at this point in the history
Convert `PDFViewer` to an ES6 class
  • Loading branch information
Snuffleupagus authored Jul 16, 2017
2 parents 5306ac6 + 72af72a commit bf70eea
Show file tree
Hide file tree
Showing 2 changed files with 780 additions and 787 deletions.
15 changes: 1 addition & 14 deletions web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ let PDFViewerApplication = {
!initialParams.hash) {
return;
}
if (this.hasEqualPageSizes) {
if (pdfViewer.hasEqualPageSizes) {
return;
}
this.initialDestination = initialParams.destination;
Expand Down Expand Up @@ -1217,19 +1217,6 @@ let PDFViewerApplication = {
}
},

// Whether all pages of the PDF have the same width and height.
get hasEqualPageSizes() {
let firstPage = this.pdfViewer.getPageView(0);
for (let i = 1, ii = this.pagesCount; i < ii; ++i) {
let pageView = this.pdfViewer.getPageView(i);
if (pageView.width !== firstPage.width ||
pageView.height !== firstPage.height) {
return false;
}
}
return true;
},

afterPrint: function pdfViewSetupAfterPrint() {
if (this.printService) {
this.printService.destroy();
Expand Down
Loading

0 comments on commit bf70eea

Please sign in to comment.