@@ -113,7 +113,7 @@ export class MdGridList implements OnInit, AfterContentChecked {
113113 private _setTileStyler ( ) : void {
114114 if ( this . _rowHeight === MD_FIT_MODE ) {
115115 this . _tileStyler = new FitTileStyler ( ) ;
116- } else if ( this . _rowHeight && this . _rowHeight . match ( / : / g ) ) {
116+ } else if ( this . _rowHeight && this . _rowHeight . indexOf ( ':' ) > - 1 ) {
117117 this . _tileStyler = new RatioTileStyler ( this . _rowHeight ) ;
118118 } else {
119119 this . _tileStyler = new FixedTileStyler ( this . _rowHeight ) ;
@@ -122,16 +122,15 @@ export class MdGridList implements OnInit, AfterContentChecked {
122122
123123 /** Computes and applies the size and position for all children grid tiles. */
124124 private _layoutTiles ( ) : void {
125- let tiles = this . _tiles . toArray ( ) ;
126- let tracker = new TileCoordinator ( this . cols , tiles ) ;
125+ let tracker = new TileCoordinator ( this . cols , this . _tiles ) ;
127126 let direction = this . _dir ? this . _dir . value : 'ltr' ;
128127 this . _tileStyler . init ( this . gutterSize , tracker , this . cols , direction ) ;
129128
130- for ( let i = 0 ; i < tiles . length ; i ++ ) {
131- let pos = tracker . positions [ i ] ;
132- let tile = tiles [ i ] ;
129+ this . _tiles . forEach ( ( tile , index ) => {
130+ let pos = tracker . positions [ index ] ;
133131 this . _tileStyler . setStyle ( tile , pos . row , pos . col ) ;
134- }
132+ } ) ;
133+
135134 this . _setListStyle ( this . _tileStyler . getComputedHeight ( ) ) ;
136135 }
137136
0 commit comments