Selaa lähdekoodia

Fixes #291, row height correction bug fixed

Torkel Ödegaard 11 vuotta sitten
vanhempi
commit
db9949d403
1 muutettua tiedostoa jossa 10 lisäystä ja 5 poistoa
  1. 10 5
      src/app/controllers/row.js

+ 10 - 5
src/app/controllers/row.js

@@ -125,12 +125,17 @@ function (angular, app, _) {
         type    : type
         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
     /** @scratch /panels/2