fix(context-pad): reopen after Lane split

Closes #392
This commit is contained in:
Nico Rehwaldt 2015-10-20 16:29:13 +02:00
parent 2807129585
commit e79e70acb4
1 changed files with 14 additions and 6 deletions

View File

@ -112,6 +112,18 @@ ContextPadProvider.prototype.getContextPadEntries = function(element) {
}; };
} }
function splitLaneHandler(count) {
return function(event, element) {
// actual split
modeling.splitLane(element, count);
// refresh context pad after split to
// get rid of split icons
contextPad.open(element, true);
};
}
if (isAny(businessObject, [ 'bpmn:Lane', 'bpmn:Participant' ])) { if (isAny(businessObject, [ 'bpmn:Lane', 'bpmn:Participant' ])) {
var childLanes = getChildLanes(element); var childLanes = getChildLanes(element);
@ -136,9 +148,7 @@ ContextPadProvider.prototype.getContextPadEntries = function(element) {
className: 'icon-lane-divide-two', className: 'icon-lane-divide-two',
title: 'Divide into two Lanes', title: 'Divide into two Lanes',
action: { action: {
click: function(event, element) { click: splitLaneHandler(2)
modeling.splitLane(element, 2);
}
} }
}, },
'lane-divide-three': { 'lane-divide-three': {
@ -146,9 +156,7 @@ ContextPadProvider.prototype.getContextPadEntries = function(element) {
className: 'icon-lane-divide-three', className: 'icon-lane-divide-three',
title: 'Divide into three Lanes', title: 'Divide into three Lanes',
action: { action: {
click: function(event, element) { click: splitLaneHandler(3)
modeling.splitLane(element, 3);
}
} }
} }
}); });