(elementFactory, create, type, group, className, title, options)
| 2 | import { notNull } from "../../../utils/tool"; |
| 3 | |
| 4 | export function createAction(elementFactory, create, type, group, className, title, options) { |
| 5 | function createListener(event) { |
| 6 | const shape = elementFactory.createShape(assign({ type: type }, options)); |
| 7 | |
| 8 | if (options) { |
| 9 | !shape.businessObject.di && (shape.businessObject.di = {}); |
| 10 | notNull(options.isExpanded) && (shape.businessObject.di.isExpanded = options.isExpanded); |
| 11 | } |
| 12 | |
| 13 | create.start(event, shape); |
| 14 | } |
| 15 | |
| 16 | return { |
| 17 | group: group, |
| 18 | className: className, |
| 19 | title: title, |
| 20 | action: { |
| 21 | dragstart: createListener, |
| 22 | click: createListener |
| 23 | } |
| 24 | }; |
| 25 | } |
no outgoing calls
no test coverage detected