mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Change var
to let
, and use object destructuring, in a couple of previously class converted web/*.js
files
Note that these files were among the first to be converted to ES6 classes, so it probably makes sense to do another pass to bring them inline with the most recent ES6 conversions.
This commit is contained in:
parent
699f3392e4
commit
614e8cf295
9 changed files with 113 additions and 118 deletions
|
@ -31,13 +31,14 @@ class AnnotationLayerBuilder {
|
|||
/**
|
||||
* @param {AnnotationLayerBuilderOptions} options
|
||||
*/
|
||||
constructor(options) {
|
||||
this.pageDiv = options.pageDiv;
|
||||
this.pdfPage = options.pdfPage;
|
||||
this.renderInteractiveForms = options.renderInteractiveForms;
|
||||
this.linkService = options.linkService;
|
||||
this.downloadManager = options.downloadManager;
|
||||
this.l10n = options.l10n || NullL10n;
|
||||
constructor({ pageDiv, pdfPage, linkService, downloadManager,
|
||||
renderInteractiveForms = false, l10n = NullL10n, }) {
|
||||
this.pageDiv = pageDiv;
|
||||
this.pdfPage = pdfPage;
|
||||
this.linkService = linkService;
|
||||
this.downloadManager = downloadManager;
|
||||
this.renderInteractiveForms = renderInteractiveForms;
|
||||
this.l10n = l10n;
|
||||
|
||||
this.div = null;
|
||||
}
|
||||
|
@ -48,7 +49,7 @@ class AnnotationLayerBuilder {
|
|||
*/
|
||||
render(viewport, intent = 'display') {
|
||||
this.pdfPage.getAnnotations({ intent, }).then((annotations) => {
|
||||
var parameters = {
|
||||
let parameters = {
|
||||
viewport: viewport.clone({ dontFlip: true, }),
|
||||
div: this.div,
|
||||
annotations,
|
||||
|
@ -68,7 +69,6 @@ class AnnotationLayerBuilder {
|
|||
if (annotations.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.div = document.createElement('div');
|
||||
this.div.className = 'annotationLayer';
|
||||
this.pageDiv.appendChild(this.div);
|
||||
|
@ -99,8 +99,7 @@ class DefaultAnnotationLayerFactory {
|
|||
* @param {IL10n} l10n
|
||||
* @returns {AnnotationLayerBuilder}
|
||||
*/
|
||||
createAnnotationLayerBuilder(pageDiv, pdfPage,
|
||||
renderInteractiveForms = false,
|
||||
createAnnotationLayerBuilder(pageDiv, pdfPage, renderInteractiveForms = false,
|
||||
l10n = NullL10n) {
|
||||
return new AnnotationLayerBuilder({
|
||||
pageDiv,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue