From 4ade805f3da2999eb9de8cf41d920f4adb59d830 Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Wed, 6 Jun 2018 14:31:31 +0200 Subject: [PATCH] style(modeling): use constant instead of magic string --- lib/features/modeling/behavior/LabelBehavior.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/features/modeling/behavior/LabelBehavior.js b/lib/features/modeling/behavior/LabelBehavior.js index df87ebcd..5dc5a52e 100644 --- a/lib/features/modeling/behavior/LabelBehavior.js +++ b/lib/features/modeling/behavior/LabelBehavior.js @@ -25,6 +25,7 @@ var DEFAULT_LABEL_DIMENSIONS = { height: 20 }; +var NAME_PROPERTY = 'name'; /** * A component that makes sure that external labels are added @@ -48,8 +49,8 @@ export default function LabelBehavior( element = context.element, properties = context.properties; - if ('name' in properties) { - modeling.updateLabel(element, properties.name); + if (NAME_PROPERTY in properties) { + modeling.updateLabel(element, properties[NAME_PROPERTY]); } });