From 3de44e88c02549453870a41a53f595946632135e Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Mon, 28 Apr 2014 11:06:29 -0700 Subject: [PATCH] constantify text code --- src/Layout.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Layout.js b/src/Layout.js index 129eb290..29ea961b 100755 --- a/src/Layout.js +++ b/src/Layout.js @@ -206,19 +206,21 @@ var computeLayout = (function() { if ('measure' in node.style) { var width; - if (isDimDefined(node, 'row')) { + if (isDimDefined(node, CSS_FLEX_DIRECTION_ROW)) { width = node.style.width; - } else if (node.style.position === 'absolute') { + } else if (node.style.position === CSS_POSITION_ABSOLUTE) { width = 'shrink'; } else { width = 'grow'; } var dimensions = node.style.measure(width); - if (!isDimDefined(node, 'row')) { - node.layout.width = dimensions.width + getPaddingAndBorderAxis(node, 'row'); + if (!isDimDefined(node, CSS_FLEX_DIRECTION_ROW)) { + node.layout.width = dimensions.width + + getPaddingAndBorderAxis(node, CSS_FLEX_DIRECTION_ROW); } - if (!isDimDefined(node, 'column')) { - node.layout.height = dimensions.height + getPaddingAndBorderAxis(node, 'column'); + if (!isDimDefined(node, CSS_FLEX_DIRECTION_COLUMN)) { + node.layout.height = dimensions.height + + getPaddingAndBorderAxis(node, CSS_FLEX_DIRECTION_COLUMN); } return; }