state

Fires when a state change occurs.


There are three events available:

  • state.save - fires when the current selection is saved.

  • state.undo - fires when the state is undone.

  • state.redo - fires when the state is redone.

The callbacks for all three events contain the current state and all states as the first and second parameters respectively.


Examples

selectable.on("state.save", function(currentState, allStates) {
    // Do something on save
});
selectable.on("state.undo", function(currentState, allStates) {
    // Do something on undo
});
selectable.on("state.redo", function(currentState, allStates) {
    // Do something on redo
});

Last updated