1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Correctly mimic the proper event-format in AnnotationElement._setDefaultPropertiesFromJS (bug 1785218)

*This is a follow-up to PR 14869.*

In the old code we're accidentally "swallowing" part of the event-details, which explains why the annotationLayer didn't render.
One thing that made debugging a lot harder was the lack of error messages, from the viewer, and a few `PDFPageView`-methods were updated to improve this situation.
This commit is contained in:
Jonas Jenwald 2022-08-17 15:44:27 +02:00
parent b05010c3eb
commit 5e126032ff
2 changed files with 14 additions and 7 deletions

View file

@ -401,7 +401,13 @@ class AnnotationElement {
for (const [actionName, detail] of Object.entries(storedData)) {
const action = commonActions[actionName];
if (action) {
action({ detail, target: element });
const eventProxy = {
detail: {
[actionName]: detail,
},
target: element,
};
action(eventProxy);
// The action has been consumed: no need to keep it.
delete storedData[actionName];
}