fix(draw): hide empty on import + show on property update

Closes #362
This commit is contained in:
Nico Rehwaldt 2015-09-14 16:03:46 +02:00
parent cc06e84cce
commit 8b5572d3c4
4 changed files with 3 additions and 8 deletions

View File

@ -291,11 +291,6 @@ function BpmnRenderer(eventBus, styles, pathMap, priority) {
function renderExternalLabel(p, element, align) {
var semantic = getSemantic(element);
if (!semantic.name) {
element.hidden = true;
}
return renderLabel(p, semantic.name, { box: element, align: align, style: { fontSize: '11px' } });
}

View File

@ -89,7 +89,7 @@ UpdatePropertiesHandler.prototype.execute = function(context) {
changed.push(element.label);
// show the label
element.label.hidden = false;
element.label.hidden = !properties[NAME];
}
// update properties

View File

@ -171,7 +171,7 @@ BpmnImporter.prototype.addLabel = function(semantic, element) {
id: semantic.id + '_label',
labelTarget: element,
type: 'label',
hidden: element.hidden,
hidden: element.hidden || !semantic.name,
x: Math.round(bounds.x),
y: Math.round(bounds.y),
width: Math.round(bounds.width),

View File

@ -52,7 +52,7 @@ describe('import - collapsed container', function() {
}));
it('should import collapsed with nested elements', inject(function(elementRegistry) {
it('should import collapsed with nested hidden labels', inject(function(elementRegistry) {
var hiddenEventShape = elementRegistry.get('StartEvent_2');
expect(hiddenEventShape.label.hidden).to.be.true;