MCPcopy Create free account
hub / github.com/angular/components / _layoutTiles

Method _layoutTiles

src/material/grid-list/grid-list.ts:162–180  ·  view source on GitHub ↗

Computes and applies the size and position for all children grid tiles.

()

Source from the content-addressed store, hash-verified

160
161 /** Computes and applies the size and position for all children grid tiles. */
162 private _layoutTiles(): void {
163 if (!this._tileCoordinator) {
164 this._tileCoordinator = new TileCoordinator();
165 }
166
167 const tracker = this._tileCoordinator;
168 const tiles = this._tiles.filter(tile => !tile._gridList || tile._gridList === this);
169 const direction = this._dir ? this._dir.value : 'ltr';
170
171 this._tileCoordinator.update(this.cols, tiles);
172 this._tileStyler.init(this.gutterSize, tracker, this.cols, direction);
173
174 tiles.forEach((tile, index) => {
175 const pos = tracker.positions[index];
176 this._tileStyler.setStyle(tile, pos.row, pos.col);
177 });
178
179 this._setListStyle(this._tileStyler.getComputedHeight());
180 }
181
182 /** Sets style on the main grid-list element, given the style name and value. */
183 _setListStyle(style: [string, string | null] | null): void {

Callers 1

ngAfterContentCheckedMethod · 0.95

Calls 6

_setListStyleMethod · 0.95
setStyleMethod · 0.80
updateMethod · 0.65
filterMethod · 0.45
initMethod · 0.45
getComputedHeightMethod · 0.45

Tested by

no test coverage detected