mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Dispatch event when annotations have finished rendering.
This is needed for some smoke tests in mozilla central for testing forms in pdf.js. Note: AnnotationLayerBuilder.render() doesn't really need to be async, but we're talking of making the annotation's render functions async, so this will make that switch easier.
This commit is contained in:
parent
ebb903e506
commit
7bba4931ad
2 changed files with 23 additions and 3 deletions
|
@ -60,9 +60,11 @@ class AnnotationLayerBuilder {
|
|||
/**
|
||||
* @param {PageViewport} viewport
|
||||
* @param {string} intent (default value is 'display')
|
||||
* @returns {Promise<void>} A promise that is resolved when rendering of the
|
||||
* annotations is complete.
|
||||
*/
|
||||
render(viewport, intent = "display") {
|
||||
this.pdfPage.getAnnotations({ intent }).then(annotations => {
|
||||
return this.pdfPage.getAnnotations({ intent }).then(annotations => {
|
||||
if (this._cancelled) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue