Browse Source

Check focused inputs in undo/redo

pull/663/head
Artur Arseniev 9 years ago
parent
commit
cb19de3cbd
  1. 23
      src/editor/model/Editor.js
  2. 2
      src/undo_manager/index.js

23
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');
});
}
},
*/

2
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);
},

Loading…
Cancel
Save