style(modeling): use constant instead of magic string
This commit is contained in:
parent
694800d51a
commit
fb5fccb331
|
@ -26,6 +26,7 @@ var DEFAULT_LABEL_DIMENSIONS = {
|
|||
};
|
||||
|
||||
var NAME_PROPERTY = 'name';
|
||||
var TEXT_PROPERTY = 'text';
|
||||
|
||||
/**
|
||||
* A component that makes sure that external labels are added
|
||||
|
@ -53,7 +54,7 @@ export default function LabelBehavior(
|
|||
modeling.updateLabel(element, properties[NAME_PROPERTY]);
|
||||
}
|
||||
|
||||
if ('text' in properties
|
||||
if (TEXT_PROPERTY in properties
|
||||
&& is(element, 'bpmn:TextAnnotation')) {
|
||||
|
||||
var newBounds = textRenderer.getTextAnnotationBounds(
|
||||
|
@ -63,7 +64,7 @@ export default function LabelBehavior(
|
|||
width: element.width,
|
||||
height: element.height
|
||||
},
|
||||
properties.text || ''
|
||||
properties[TEXT_PROPERTY] || ''
|
||||
);
|
||||
|
||||
modeling.updateLabel(element, properties.text, newBounds);
|
||||
|
|
Loading…
Reference in New Issue