Merge pull request #8636 from Snuffleupagus/es6-PDFViewer-class

Convert `PDFViewer` to an ES6 class
This commit is contained in:
Jonas Jenwald 2017-07-16 15:57:22 +02:00 committed by GitHub
commit 5187f0fcbb
2 changed files with 800 additions and 807 deletions

View File

@ -977,7 +977,7 @@ let PDFViewerApplication = {
!initialParams.hash) {
return;
}
if (this.hasEqualPageSizes) {
if (pdfViewer.hasEqualPageSizes) {
return;
}
this.initialDestination = initialParams.destination;
@ -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();

File diff suppressed because it is too large Load Diff