bpmn-js/lib/features/distribute-elements/BpmnDistributeElements.js
Nico Rehwaldt 9be61259bd chore(project): drop 'use strict'
We use ES modules, so 'use strict' is not necessary anymore.
2018-04-03 18:09:53 +02:00

35 lines
835 B
JavaScript

import {
filter
} from 'min-dash';
import {
isAny
} from '../modeling/util/ModelingUtil';
/**
* Registers element exclude filters for elements that
* currently do not support distribution.
*/
export default function BpmnDistributeElements(distributeElements) {
distributeElements.registerFilter(function(elements) {
return filter(elements, function(element) {
var cannotDistribute = isAny(element, [
'bpmn:Association',
'bpmn:BoundaryEvent',
'bpmn:DataInputAssociation',
'bpmn:DataOutputAssociation',
'bpmn:Lane',
'bpmn:MessageFlow',
'bpmn:Participant',
'bpmn:SequenceFlow',
'bpmn:TextAnnotation'
]);
return !(element.labelTarget || cannotDistribute);
});
});
}
BpmnDistributeElements.$inject = [ 'distributeElements' ];