feat(features/context-pad): focus elements after append

This commit is contained in:
Nico Rehwaldt 2014-07-18 15:29:41 +02:00
parent 1947a9c4de
commit f02b741c85
2 changed files with 8 additions and 3 deletions

View File

@ -20,21 +20,23 @@ var images = {
* *
* @param {ContextPad} contextPad * @param {ContextPad} contextPad
*/ */
function ContextPadProvider(contextPad, directEditing, bpmnModeling) { function ContextPadProvider(contextPad, directEditing, bpmnModeling, selection) {
contextPad.registerProvider(this); contextPad.registerProvider(this);
this._selection = selection;
this._directEditing = directEditing; this._directEditing = directEditing;
this._bpmnModeling = bpmnModeling; this._bpmnModeling = bpmnModeling;
} }
ContextPadProvider.$inject = [ 'contextPad', 'directEditing', 'bpmnModeling' ]; ContextPadProvider.$inject = [ 'contextPad', 'directEditing', 'bpmnModeling', 'selection' ];
ContextPadProvider.prototype.getContextPadEntries = function(element) { ContextPadProvider.prototype.getContextPadEntries = function(element) {
var directEditing = this._directEditing, var directEditing = this._directEditing,
bpmnModeling = this._bpmnModeling; bpmnModeling = this._bpmnModeling,
selection = this._selection;
var actions = {}; var actions = {};
@ -46,6 +48,8 @@ ContextPadProvider.prototype.getContextPadEntries = function(element) {
function append(element, type) { function append(element, type) {
var target = bpmnModeling.appendFlowNode(element, null, type); var target = bpmnModeling.appendFlowNode(element, null, type);
selection.select(target);
directEditing.activate(target); directEditing.activate(target);
} }

View File

@ -1,6 +1,7 @@
module.exports = { module.exports = {
__depends__: [ __depends__: [
require('diagram-js/lib/features/context-pad'), require('diagram-js/lib/features/context-pad'),
require('diagram-js/lib/features/selection'),
require('diagram-js-direct-editing'), require('diagram-js-direct-editing'),
require('../bpmn-modeling') require('../bpmn-modeling')
], ],