mirror of
https://github.com/sartography/bpmn-js.git
synced 2025-01-14 11:04:15 +00:00
improve(contextpad): remove modeling options behind throwing link events
related #219
This commit is contained in:
parent
6aceab9dbf
commit
2321caecd7
@ -1,7 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
var assign = require('lodash/object/assign');
|
var assign = require('lodash/object/assign'),
|
||||||
|
forEach = require('lodash/collection/forEach');
|
||||||
|
|
||||||
var getReplacementMenuEntries = require('./ReplaceMenuFactory').getReplacementMenuEntries;
|
var getReplacementMenuEntries = require('./ReplaceMenuFactory').getReplacementMenuEntries;
|
||||||
|
|
||||||
@ -117,7 +118,8 @@ ContextPadProvider.prototype.getContextPadEntries = function(element) {
|
|||||||
if (bpmnElement.$instanceOf('bpmn:FlowNode')) {
|
if (bpmnElement.$instanceOf('bpmn:FlowNode')) {
|
||||||
|
|
||||||
if (!bpmnElement.$instanceOf('bpmn:EndEvent') &&
|
if (!bpmnElement.$instanceOf('bpmn:EndEvent') &&
|
||||||
!bpmnElement.$instanceOf('bpmn:EventBasedGateway')) {
|
!bpmnElement.$instanceOf('bpmn:EventBasedGateway') &&
|
||||||
|
!isEventType(bpmnElement, 'bpmn:IntermediateThrowEvent', 'bpmn:LinkEventDefinition')) {
|
||||||
|
|
||||||
assign(actions, {
|
assign(actions, {
|
||||||
'append.end-event': appendAction('bpmn:EndEvent', 'icon-01-none-end-event'),
|
'append.end-event': appendAction('bpmn:EndEvent', 'icon-01-none-end-event'),
|
||||||
@ -208,5 +210,20 @@ ContextPadProvider.prototype.getContextPadEntries = function(element) {
|
|||||||
return actions;
|
return actions;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function isEventType(eventBo, type, definition) {
|
||||||
|
|
||||||
|
var isType = eventBo.$instanceOf(type);
|
||||||
|
var isDefinition = false;
|
||||||
|
|
||||||
|
var definitions = eventBo.eventDefinitions || [];
|
||||||
|
forEach(definitions, function(def) {
|
||||||
|
if (def.$type === definition) {
|
||||||
|
isDefinition = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return isType && isDefinition;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
module.exports = ContextPadProvider;
|
module.exports = ContextPadProvider;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user