WIP
This commit is contained in:
parent
973ac6e35a
commit
71416249d5
|
@ -1,6 +1,6 @@
|
||||||
import inherits from 'inherits';
|
import inherits from 'inherits';
|
||||||
|
|
||||||
import { forEach } from 'min-dash';
|
import { forEach, reduce } from 'min-dash';
|
||||||
|
|
||||||
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
import CommandInterceptor from 'diagram-js/lib/command/CommandInterceptor';
|
||||||
|
|
||||||
|
@ -30,10 +30,14 @@ export default function ReplaceElementBehaviour(
|
||||||
target = context.parent,
|
target = context.parent,
|
||||||
elements = context.elements;
|
elements = context.elements;
|
||||||
|
|
||||||
var canReplace = bpmnRules.canReplace(elements, target);
|
var elementReplacements = reduce(elements, function(replacements, element) {
|
||||||
|
var canReplace = bpmnRules.canReplace([ element ], element.host || element.parent || target);
|
||||||
|
|
||||||
if (canReplace) {
|
return canReplace ? replacements.concat(canReplace.replacements) : replacements;
|
||||||
this.replaceElements(elements, canReplace.replacements);
|
}, []);
|
||||||
|
|
||||||
|
if (elementReplacements.length) {
|
||||||
|
this.replaceElements(elements, elementReplacements);
|
||||||
}
|
}
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue