diff --git a/src/editor/model/Editor.js b/src/editor/model/Editor.js index e440f22cf..2bf23328b 100644 --- a/src/editor/model/Editor.js +++ b/src/editor/model/Editor.js @@ -232,11 +232,6 @@ module.exports = Backbone.Model.extend({ * @private * * initUndoManager() { - const canvas = this.get('Canvas'); - - if (this.um) { - return; - } var cmp = this.get('DomComponents'); if(cmp && this.config.undoManager) { @@ -245,25 +240,7 @@ module.exports = Backbone.Model.extend({ register: [cmp.getComponents(), this.get('CssComposer').getAll()], track: true }); - this.UndoManager = this.um; - this.set('UndoManager', this.um); - - key('⌘+z, ctrl+z', () => { - if (canvas.isInputFocused()) { - return; - } - that.um.undo(true); - that.trigger('component:update'); - }); - - key('⌘+shift+z, ctrl+shift+z', () => { - if (canvas.isInputFocused()) { - return; - } - that.um.redo(true); - that.trigger('component:update'); - }); } }, */ diff --git a/src/undo_manager/index.js b/src/undo_manager/index.js index 6b46f9ecc..de701818f 100644 --- a/src/undo_manager/index.js +++ b/src/undo_manager/index.js @@ -201,6 +201,7 @@ module.exports = () => { * Undo last change */ undo() { + if (em.get('Canvas').isInputFocused()) return; um.undo(1); }, @@ -217,6 +218,7 @@ module.exports = () => { * Redo last change */ redo() { + if (em.get('Canvas').isInputFocused()) return; um.redo(1); },