Merge pull request #10119 from Snuffleupagus/rm-onFileAttachmentAnnotation

Attempt to simplify the `fileattachmentannotation` event dispatching
This commit is contained in:
Tim van der Meij 2018-10-02 23:25:22 +02:00 committed by GitHub
commit 138324502c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 30 deletions

View File

@ -1130,15 +1130,18 @@ class FileAttachmentAnnotationElement extends AnnotationElement {
constructor(parameters) {
super(parameters, /* isRenderable = */ true);
let file = this.data.file;
this.filename = getFilenameFromUrl(file.filename);
this.content = file.content;
const { filename, content, } = this.data.file;
this.filename = getFilenameFromUrl(filename);
this.content = content;
this.linkService.onFileAttachmentAnnotation({
id: stringToPDFString(file.filename),
filename: file.filename,
content: file.content,
});
if (this.linkService.eventBus) {
this.linkService.eventBus.dispatch('fileattachmentannotation', {
source: this,
id: stringToPDFString(filename),
filename,
content,
});
}
}
/**

View File

@ -67,11 +67,6 @@ class IPDFLinkService {
*/
executeNamedAction(action) {}
/**
* @param {Object} params
*/
onFileAttachmentAnnotation({ id, filename, content, }) {}
/**
* @param {number} pageNum - page number.
* @param {Object} pageRef - reference to the page.

View File

@ -337,18 +337,6 @@ class PDFLinkService {
});
}
/**
* @param {Object} params
*/
onFileAttachmentAnnotation({ id, filename, content, }) {
this.eventBus.dispatch('fileattachmentannotation', {
source: this,
id,
filename,
content,
});
}
/**
* @param {number} pageNum - page number.
* @param {Object} pageRef - reference to the page.
@ -481,11 +469,6 @@ class SimpleLinkService {
*/
executeNamedAction(action) {}
/**
* @param {Object} params
*/
onFileAttachmentAnnotation({ id, filename, content, }) {}
/**
* @param {number} pageNum - page number.
* @param {Object} pageRef - reference to the page.