fix(pdfjs): saves as soon as document is opened

This commit is contained in:
Elian Doran 2026-01-04 17:06:41 +02:00
parent 69511134e5
commit e485b75a44
No known key found for this signature in database

View File

@ -81,16 +81,11 @@ function manageSave() {
}
});
app.pdfDocument.annotationStorage.onSetModified = onChange; // works great for most cases, including forms.
app.eventBus.on("annotationeditorcommit", onChange);
app.eventBus.on("annotationeditorparamschanged", onChange);
app.eventBus.on("annotationeditorstateschanged", evt => { // needed for detecting when annotations are moved around.
const { activeEditorId } = evt;
// When activeEditorId becomes null, an editor was just committed
if (activeEditorId === null) {
onChange();
}
app.pdfDocument.annotationStorage.onSetModified = () => {
onChange();
}; // works great for most cases, including forms.
app.eventBus.on("switchannotationeditorparams", () => {
onChange();
});
}