Merge pull request #8636 from Snuffleupagus/es6-PDFViewer-class
Convert `PDFViewer` to an ES6 class
This commit is contained in:
commit
5187f0fcbb
15
web/app.js
15
web/app.js
@ -977,7 +977,7 @@ let PDFViewerApplication = {
|
|||||||
!initialParams.hash) {
|
!initialParams.hash) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.hasEqualPageSizes) {
|
if (pdfViewer.hasEqualPageSizes) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.initialDestination = initialParams.destination;
|
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() {
|
afterPrint: function pdfViewSetupAfterPrint() {
|
||||||
if (this.printService) {
|
if (this.printService) {
|
||||||
this.printService.destroy();
|
this.printService.destroy();
|
||||||
|
1592
web/pdf_viewer.js
1592
web/pdf_viewer.js
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user