diff --git a/src/editor/index.js b/src/editor/index.js index fac28d08f..70ffbb6a1 100644 --- a/src/editor/index.js +++ b/src/editor/index.js @@ -51,6 +51,8 @@ * * `stop:{commandName}` - Triggered when some command is called to stop (eg. editor.stopCommand('preview')) * ## General * * `canvasScroll` - Triggered when the canvas is scrolle + * * `undo` - Undo executed + * * `redo` - Redo executed * * `load` - When the editor is loaded * * @param {Object} config Configurations diff --git a/src/undo_manager/index.js b/src/undo_manager/index.js index b9774ba50..6520898ba 100644 --- a/src/undo_manager/index.js +++ b/src/undo_manager/index.js @@ -61,6 +61,7 @@ module.exports = () => { const events = ['style', 'attributes', 'content', 'src']; events.forEach(ev => um.addUndoType(`change:${ev}`, customUndoType)); um.on('undo redo', () => em.trigger('change:selectedComponent change:canvasOffset')); + ['undo', 'redo'].forEach(ev => um.on(ev, () => em.trigger(ev))); return this; },