Know if there is modification before close diagram


#1

Hi,

I would like to know if we can know if there is modification on a diagram open on the modeler since the last save (in order to ask for saving before close)

Moreover, if this is possible to know if there is an action that have been undo (in order to disabled undo and/or redo button)

Thanks,
Romain.


#2

Sorry for that question, I just find the solution with :

this.modeler.get(‘commandStack’).canRedo()

To be sure, did the commandStack impletent this ? No

note all function are implemented but I find :

  • undo/redo
  • canUndo/canRedo
  • clear (I clear the commandStack when I save the diagram)

If you know others ones, I appreciate that you give me them (boring to try one by one if they exist)

Romain


#3

You can see how the command stack is implemented here. Hope that helps.


#4

Thank you !

that’s exactly what I was looking for :slight_smile: .
probably I should look more on the github and less on my package. I never think about blob.

Romain