feat(keyboard): add direct editing -> e binding

Related to #243
This commit is contained in:
Nico Rehwaldt 2015-05-06 18:09:13 +02:00
parent d54ee97aa1
commit bacd2b4322
1 changed files with 13 additions and 2 deletions

View File

@ -1,7 +1,7 @@
'use strict';
function BpmnKeyBindings(keyboard, spaceTool, lassoTool) {
function BpmnKeyBindings(keyboard, spaceTool, lassoTool, directEditing, selection) {
keyboard.addListener(function(key, modifiers) {
@ -22,9 +22,20 @@ function BpmnKeyBindings(keyboard, spaceTool, lassoTool) {
return true;
}
var currentSelection = selection.get();
// E -> activate direct editing
if (key === 69) {
if (currentSelection.length) {
directEditing.activate(currentSelection[0]);
}
return true;
}
});
}
BpmnKeyBindings.$inject = [ 'keyboard', 'spaceTool', 'lassoTool' ];
BpmnKeyBindings.$inject = [ 'keyboard', 'spaceTool', 'lassoTool', 'directEditing', 'selection' ];
module.exports = BpmnKeyBindings;