mirror of
https://github.com/bpmn-io/bpmn-js.git
synced 2025-08-14 19:25:06 +08:00

This increase the safety of our build; external consumers do no longer need to account for the `browser` field to bundle bpmn-js (or otherwise bundle a Node shim, unintentionally).
28 lines
699 B
JavaScript
28 lines
699 B
JavaScript
import inherits from 'inherits-browser';
|
|
|
|
import { is } from '../../../util/ModelUtil';
|
|
|
|
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
|
|
|
import { getParent } from '../util/ModelingUtil';
|
|
|
|
|
|
export default function CreateBehavior(injector) {
|
|
injector.invoke(CommandInterceptor, this);
|
|
|
|
this.preExecute('shape.create', 1500, function(event) {
|
|
var context = event.context,
|
|
parent = context.parent,
|
|
shape = context.shape;
|
|
|
|
if (is(parent, 'bpmn:Lane') && !is(shape, 'bpmn:Lane')) {
|
|
context.parent = getParent(parent, 'bpmn:Participant');
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
|
|
CreateBehavior.$inject = [ 'injector' ];
|
|
|
|
inherits(CreateBehavior, CommandInterceptor); |