From db9949d403e684aa7cd9d371dd93afef7b84932f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 7 Apr 2014 08:33:52 +0200 Subject: [PATCH] Fixes #291, row height correction bug fixed --- src/app/controllers/row.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/app/controllers/row.js b/src/app/controllers/row.js index 87b3ad5ce64..16005ba5dd6 100644 --- a/src/app/controllers/row.js +++ b/src/app/controllers/row.js @@ -125,12 +125,17 @@ function (angular, app, _) { type : type }; - if (!$scope.row.height) { - $scope.row.height = "200px"; - } - else if($scope.row.height.indexOf('px') === -1) { - $scope.row.height = $scope.row.height + 'px'; + function fixRowHeight(height) { + if (!height) { + return '200px'; + } + if (!_.isString(height)) { + return height + 'px'; + } + return height; } + + $scope.row.height = fixRowHeight($scope.row.height); }; /** @scratch /panels/2