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

Method setPositionClasses

src/material/menu/menu.ts:442–452  ·  view source on GitHub ↗

* Adds classes to the menu panel based on its position. Can be used by * consumers to add specific styling based on the position. * @param posX Position of the menu along the x axis. * @param posY Position of the menu along the y axis. * @docs-private

(posX: MenuPositionX = this.xPosition, posY: MenuPositionY = this.yPosition)

Source from the content-addressed store, hash-verified

440 * @docs-private
441 */
442 setPositionClasses(posX: MenuPositionX = this.xPosition, posY: MenuPositionY = this.yPosition) {
443 this._classList = {
444 ...this._classList,
445 ['mat-menu-before']: posX === 'before',
446 ['mat-menu-after']: posX === 'after',
447 ['mat-menu-above']: posY === 'above',
448 ['mat-menu-below']: posY === 'below',
449 };
450
451 this._changeDetectorRef.markForCheck();
452 }
453
454 /** Callback that is invoked when the panel animation completes. */
455 protected _onAnimationDone(state: string) {

Callers 3

xPositionMethod · 0.95
yPositionMethod · 0.95
ngOnInitMethod · 0.95

Calls 1

markForCheckMethod · 0.80

Tested by

no test coverage detected