feat(features/context-pad): focus elements after append
This commit is contained in:
parent
1947a9c4de
commit
f02b741c85
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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')
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in New Issue