mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Attempt to simplify the fileattachmentannotation
event dispatching
This attempts to reduced the level of indirection, and the amount of code, when dispatching `fileattachmentannotation` events, by removing the `PDFLinkService.onFileAttachmentAnnotation` method and just accessing `PDFLinkService.eventBus` directly in the `FileAttachmentAnnotationElement` constructor. Given that other properties, such as `externalLinkTarget`/`externalLinkRel`, are already being accessed directly this pattern seems fine here as well.
This commit is contained in:
parent
ec10cae5b6
commit
d60ce998f1
3 changed files with 11 additions and 30 deletions
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue