From e79e70acb4ff43a008e02f9ac9e3c77399ac2c40 Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Tue, 20 Oct 2015 16:29:13 +0200 Subject: [PATCH] fix(context-pad): reopen after Lane split Closes #392 --- .../context-pad/ContextPadProvider.js | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/features/context-pad/ContextPadProvider.js b/lib/features/context-pad/ContextPadProvider.js index 8eeeaf45..4885b636 100644 --- a/lib/features/context-pad/ContextPadProvider.js +++ b/lib/features/context-pad/ContextPadProvider.js @@ -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' ])) { var childLanes = getChildLanes(element); @@ -136,9 +148,7 @@ ContextPadProvider.prototype.getContextPadEntries = function(element) { className: 'icon-lane-divide-two', title: 'Divide into two Lanes', action: { - click: function(event, element) { - modeling.splitLane(element, 2); - } + click: splitLaneHandler(2) } }, 'lane-divide-three': { @@ -146,9 +156,7 @@ ContextPadProvider.prototype.getContextPadEntries = function(element) { className: 'icon-lane-divide-three', title: 'Divide into three Lanes', action: { - click: function(event, element) { - modeling.splitLane(element, 3); - } + click: splitLaneHandler(3) } } });