Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix(grid-list): validate that row height is defined
Browse files Browse the repository at this point in the history
- throwing more informative error about missing row height attribute

fixes #6870

  Closes #7348
  • Loading branch information
EladBezalel authored and ThomasBurleson committed Mar 1, 2016
1 parent 2df6cff commit a8b886a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/gridList/grid-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,10 @@ function GridListDirective($interpolate, $mdConstant, $mdGridLayout, $mdMedia) {

function getRowHeight() {
var rowHeight = $mdMedia.getResponsiveAttribute(attrs, 'md-row-height');
if (!rowHeight) {
throw 'md-grid-list: md-row-height attribute was not found';
}

switch (getRowMode()) {
case 'fixed':
return applyDefaultUnit(rowHeight);
Expand All @@ -395,6 +399,10 @@ function GridListDirective($interpolate, $mdConstant, $mdGridLayout, $mdMedia) {

function getRowMode() {
var rowHeight = $mdMedia.getResponsiveAttribute(attrs, 'md-row-height');
if (!rowHeight) {
throw 'md-grid-list: md-row-height attribute was not found';
}

if (rowHeight == 'fit') {
return 'fit';
} else if (rowHeight.indexOf(':') !== -1) {
Expand Down

0 comments on commit a8b886a

Please sign in to comment.