Question : SavePage, detect if a save is needed
Hi, i'd like to provide visual feedback to the user that a "save page" is needed or not. What would be the best approach about it?
I have tried project.onChangeDocument but this only fires if you open a new document. I have also tried doc.history.onChangeCursor but when you take new actions cursor always stays the same (i guess because history goes like -1 -2 -3 and current cursor is always 0)
Best regards,
project.getCurrentDocument().history.isSavePoint() try this
Thanks @JackLian this probably gives me the data i'm looking for. But that's not an event, how can i "listen" to the changes so that i can auto enable/disable the save button?
try combine these two ways together, 1. check if isSavePoint === true when plugin inited, 2. monitor onChangeDocument, on event fired, check isSavePoint again. should be working
@JackLian onChangeDocument only fires if you load a completely different document. It doesn't fire when you add a new button or another component to the current document. What i'm looking for sounds like a schema change event
emmmm, well then we should provide an api to fire on every change, try this, monitor onAddNode onRemoveNode onChangeNodeProp at the same time,should cover all the cases