MCPcopy
hub / github.com/angular/components / updatePosition

Method updatePosition

src/material/dialog/dialog-ref.ts:197–215  ·  view source on GitHub ↗

* Updates the dialog's position. * @param position New dialog position.

(position?: DialogPosition)

Source from the content-addressed store, hash-verified

195 * @param position New dialog position.
196 */
197 updatePosition(position?: DialogPosition): this {
198 let strategy = this._ref.config.positionStrategy as GlobalPositionStrategy;
199
200 if (position && (position.left || position.right)) {
201 position.left ? strategy.left(position.left) : strategy.right(position.right);
202 } else {
203 strategy.centerHorizontally();
204 }
205
206 if (position && (position.top || position.bottom)) {
207 position.top ? strategy.top(position.top) : strategy.bottom(position.bottom);
208 } else {
209 strategy.centerVertically();
210 }
211
212 this._ref.updatePosition();
213
214 return this;
215 }
216
217 /**
218 * Updates the dialog's width and height.

Callers 6

positionMethod · 0.45
_updateTooltipMessageMethod · 0.45
openMethod · 0.45
dialog.spec.tsFile · 0.45
ngOnChangesFunction · 0.45
_openOverlayFunction · 0.45

Calls 6

centerHorizontallyMethod · 0.80
topMethod · 0.80
bottomMethod · 0.80
centerVerticallyMethod · 0.80
leftMethod · 0.45
rightMethod · 0.45

Tested by

no test coverage detected