improve(elementfactory): changed default size for SubProcesses
- expanded: with enough space for a small process - collapsed: same size as Tasks
This commit is contained in:
parent
0ffdbb7fbb
commit
5633dc0b78
|
@ -38,8 +38,6 @@ ElementFactory.prototype.createWithBpmn = function(elementType, attrs) {
|
||||||
businessObject = this._bpmnFactory.create(attrs.type);
|
businessObject = this._bpmnFactory.create(attrs.type);
|
||||||
}
|
}
|
||||||
|
|
||||||
size = this._getDefaultSize(businessObject);
|
|
||||||
|
|
||||||
if (!businessObject.di) {
|
if (!businessObject.di) {
|
||||||
if (elementType === 'connection') {
|
if (elementType === 'connection') {
|
||||||
businessObject.di = this._bpmnFactory.createDiEdge(businessObject, [], {
|
businessObject.di = this._bpmnFactory.createDiEdge(businessObject, [], {
|
||||||
|
@ -56,6 +54,8 @@ ElementFactory.prototype.createWithBpmn = function(elementType, attrs) {
|
||||||
businessObject.di.isExpanded = attrs.isExpanded;
|
businessObject.di.isExpanded = attrs.isExpanded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size = this._getDefaultSize(businessObject);
|
||||||
|
|
||||||
attrs = _.extend({
|
attrs = _.extend({
|
||||||
businessObject: businessObject,
|
businessObject: businessObject,
|
||||||
id: businessObject.id
|
id: businessObject.id
|
||||||
|
@ -82,6 +82,16 @@ ElementFactory.prototype.createConnection = function(attrs) {
|
||||||
|
|
||||||
ElementFactory.prototype._getDefaultSize = function(semantic) {
|
ElementFactory.prototype._getDefaultSize = function(semantic) {
|
||||||
|
|
||||||
|
if (semantic.$instanceOf('bpmn:SubProcess')) {
|
||||||
|
var isExpanded = semantic.di.isExpanded === true;
|
||||||
|
|
||||||
|
if (isExpanded) {
|
||||||
|
return { width: 350, height: 200 };
|
||||||
|
} else {
|
||||||
|
return { width: 100, height: 80 };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (semantic.$instanceOf('bpmn:Task')) {
|
if (semantic.$instanceOf('bpmn:Task')) {
|
||||||
return { width: 100, height: 80 };
|
return { width: 100, height: 80 };
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue