mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
JS -- Add listener for sandbox events only if there are some actions
* When no actions then set it to null instead of empty object * Even if a field has no actions, it needs to listen to events from the sandbox in order to be updated if an action changes something in it.
This commit is contained in:
parent
55f55f5859
commit
a5279897a7
13 changed files with 170 additions and 28 deletions
|
@ -903,6 +903,14 @@ class PDFDocumentProxy {
|
|||
return this._transport.getFieldObjects();
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Promise<boolean>} A promise that is resolved with `true`
|
||||
* if some /AcroForm fields have JavaScript actions.
|
||||
*/
|
||||
hasJSActions() {
|
||||
return this._transport.hasJSActions();
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Promise<Array<string> | null>} A promise that is resolved with an
|
||||
* {Array<string>} containing IDs of annotations that have a calculation
|
||||
|
@ -2568,6 +2576,10 @@ class WorkerTransport {
|
|||
return this.messageHandler.sendWithPromise("GetFieldObjects", null);
|
||||
}
|
||||
|
||||
hasJSActions() {
|
||||
return this.messageHandler.sendWithPromise("HasJSActions", null);
|
||||
}
|
||||
|
||||
getCalculationOrderIds() {
|
||||
return this.messageHandler.sendWithPromise("GetCalculationOrderIds", null);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue