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

Method setPositionClasses

src/material/menu/menu.ts:444–454  ·  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

442 * @docs-private
443 */
444 setPositionClasses(posX: MenuPositionX = this.xPosition, posY: MenuPositionY = this.yPosition) {
445 this._classList = {
446 ...this._classList,
447 ['mat-menu-before']: posX === 'before',
448 ['mat-menu-after']: posX === 'after',
449 ['mat-menu-above']: posY === 'above',
450 ['mat-menu-below']: posY === 'below',
451 };
452
453 this._changeDetectorRef.markForCheck();
454 }
455
456 /** Callback that is invoked when the panel animation completes. */
457 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