style(modeling): use constant instead of magic string

This commit is contained in:
Nico Rehwaldt 2018-06-13 11:08:46 +02:00
parent 694800d51a
commit fb5fccb331
1 changed files with 3 additions and 2 deletions

View File

@ -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);