mirror of
https://github.com/zadam/trilium.git
synced 2026-01-11 09:04:28 +01:00
fix(pdfjs): saves as soon as document is opened
This commit is contained in:
parent
69511134e5
commit
e485b75a44
@ -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();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user