From c5ce6525a5891ecbb0efd1cfa13609a18fbae523 Mon Sep 17 00:00:00 2001 From: jos Date: Wed, 19 Jul 2017 13:56:14 +0200 Subject: [PATCH] Implemented key bindings for undo/redo --- src/components/TreeMode.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/TreeMode.js b/src/components/TreeMode.js index 1966e31..c4590a5 100644 --- a/src/components/TreeMode.js +++ b/src/components/TreeMode.js @@ -47,6 +47,8 @@ const KEY_BINDINGS = { 'insert': ['Ctrl+Insert', 'Command+Insert'], 'remove': ['Ctrl+Delete', 'Command+Delete'], 'actionMenu': ['Ctrl+M', 'Command+M'], + 'undo': ['Ctrl+Z', 'Command+Z'], + 'redo': ['Ctrl+Shift+Z', 'Command+Shift+Z'], 'find': ['Ctrl+F', 'Command+F'], 'findNext': ['F3', 'Ctrl+G', 'Command+G'], 'findPrevious': ['Shift+F3', 'Ctrl+Shift+G', 'Command+Shift+G'], @@ -71,6 +73,8 @@ export default class TreeMode extends Component { 'down': (event) => moveDown(event.target), 'left': (event) => moveLeft(event.target), 'right': (event) => moveRight(event.target), + 'undo': (event) => this.undo(), + 'redo': (event) => this.redo(), 'find': (event) => selectFind(event.target), 'findNext': (event) => this.handleNext(), 'findPrevious': (event) => this.handlePrevious()