'this'-Schlüsselwort in 'Annotation' durch 'Annotation' ersetzt, da dieser Schlüsselwort statisch ist.

This commit is contained in:
Developer 02 2024-06-18 19:11:07 +02:00
parent 95958f2a1d
commit 56df8234c7
2 changed files with 10 additions and 12 deletions

View File

@ -3,7 +3,7 @@
const annotations = []
document.elements.forEach((element) => {
const [annotation, formField] = this.createAnnotationFromElement(element)
const [annotation, formField] = Annotation.createAnnotationFromElement(element)
annotations.push(annotation)
annotations.push(formField)
})
@ -24,14 +24,14 @@
}
static async deleteAnnotations(instance) {
const allAnnotations = await this.getAnnotations(instance)
const pageAnnotations = allAnnotations.filter(this.isSignature)
const allAnnotations = await Annotation.getAnnotations(instance)
const pageAnnotations = allAnnotations.filter(Annotation.isSignature)
//deleting all Annotations
return await instance.delete(pageAnnotations)
}
static async validateAnnotations(instance) {
const allAnnotations = await this.getAnnotations(instance)
const allAnnotations = await Annotation.getAnnotations(instance)
const pageAnnotations = allAnnotations
.map((annotation) => {
return annotation
@ -46,12 +46,12 @@
static createAnnotationFromElement(element) {
const id = PSPDFKit.generateInstantId()
const width = this.inchToPoint(element.width)
const height = this.inchToPoint(element.height)
const top = this.inchToPoint(element.top) - height / 2
const left = this.inchToPoint(element.left) - width / 2
const width = Annotation.inchToPoint(element.width)
const height = Annotation.inchToPoint(element.height)
const top = Annotation.inchToPoint(element.top) - height / 2
const left = Annotation.inchToPoint(element.left) - width / 2
const page = element.page - 1
const annotation = this.createSignatureAnnotation(
const annotation = Annotation.createSignatureAnnotation(
id,
width,
height,

View File

@ -70,9 +70,7 @@ class App {
// Load annotations into PSPDFKit
try {
this.signatureCount = this.currentDocument.elements.length
const annotations = Annotation.createAnnotations(
this.currentDocument
)
const annotations = Annotation.createAnnotations(this.currentDocument)
await this.Instance.create(annotations)
const openResponse = await this.Network.openDocument(this.envelopeKey)