mirror of
https://github.com/sartography/bpmn-js.git
synced 2025-02-18 20:06:54 +00:00
feat(replace): auto-resize height when toggling pool collapse/expand
This commit is contained in:
parent
a40b95cf2f
commit
0f7b8f483c
@ -67,8 +67,9 @@ function toggeling(element, target) {
|
|||||||
* This module takes care of replacing BPMN elements
|
* This module takes care of replacing BPMN elements
|
||||||
*/
|
*/
|
||||||
export default function BpmnReplace(
|
export default function BpmnReplace(
|
||||||
bpmnFactory, replace, selection,
|
bpmnFactory, elementFactory, replace,
|
||||||
modeling, eventBus) {
|
selection, modeling, eventBus
|
||||||
|
) {
|
||||||
|
|
||||||
var helper = new ModelCloneHelper(eventBus, bpmnFactory);
|
var helper = new ModelCloneHelper(eventBus, bpmnFactory);
|
||||||
|
|
||||||
@ -193,9 +194,9 @@ export default function BpmnReplace(
|
|||||||
hints.moveChildren = false;
|
hints.moveChildren = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// apply same size
|
// apply same width and default height
|
||||||
newElement.width = element.width;
|
newElement.width = element.width;
|
||||||
newElement.height = element.height;
|
newElement.height = elementFactory._getDefaultSize(newBusinessObject).height;
|
||||||
}
|
}
|
||||||
|
|
||||||
newBusinessObject.name = oldBusinessObject.name;
|
newBusinessObject.name = oldBusinessObject.name;
|
||||||
@ -234,6 +235,7 @@ export default function BpmnReplace(
|
|||||||
|
|
||||||
BpmnReplace.$inject = [
|
BpmnReplace.$inject = [
|
||||||
'bpmnFactory',
|
'bpmnFactory',
|
||||||
|
'elementFactory',
|
||||||
'replace',
|
'replace',
|
||||||
'selection',
|
'selection',
|
||||||
'modeling',
|
'modeling',
|
||||||
@ -261,4 +263,4 @@ function intersection(a1, a2) {
|
|||||||
return a1.filter(function(el) {
|
return a1.filter(function(el) {
|
||||||
return a2.indexOf(el) !== -1;
|
return a2.indexOf(el) !== -1;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -298,6 +298,10 @@ describe('features/replace - bpmn replace', function() {
|
|||||||
// then
|
// then
|
||||||
expect(isExpanded(newShape)).to.be.false; // collapsed
|
expect(isExpanded(newShape)).to.be.false; // collapsed
|
||||||
expect(newShape.children).to.be.empty;
|
expect(newShape.children).to.be.empty;
|
||||||
|
|
||||||
|
expect(newShape.width).to.equal(shape.width);
|
||||||
|
// default height for collapsed pool
|
||||||
|
expect(newShape.height).to.equal(100);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
@ -312,6 +316,10 @@ describe('features/replace - bpmn replace', function() {
|
|||||||
// then
|
// then
|
||||||
expect(isExpanded(newShape)).to.be.true; // expanded
|
expect(isExpanded(newShape)).to.be.true; // expanded
|
||||||
expect(newShape.children).to.be.empty;
|
expect(newShape.children).to.be.empty;
|
||||||
|
|
||||||
|
expect(newShape.width).to.equal(shape.width);
|
||||||
|
// default height for expanded pool
|
||||||
|
expect(newShape.height).to.equal(250);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -1504,4 +1512,4 @@ function skipId(key, value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user