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

Method _watchDrawerToggle

src/material/sidenav/drawer.ts:964–975  ·  view source on GitHub ↗

* Subscribes to drawer events in order to set a class on the main container element when the * drawer is open and the backdrop is visible. This ensures any overflow on the container element * is properly hidden.

(drawer: MatDrawer)

Source from the content-addressed store, hash-verified

962 * is properly hidden.
963 */
964 private _watchDrawerToggle(drawer: MatDrawer): void {
965 drawer._animationStarted.pipe(takeUntil(this._drawers.changes)).subscribe(() => {
966 this.updateContentMargins();
967 this._changeDetectorRef.markForCheck();
968 });
969
970 if (drawer.mode !== 'side') {
971 drawer.openedChange
972 .pipe(takeUntil(this._drawers.changes))
973 .subscribe(() => this._setContainerClass(drawer.opened));
974 }
975 }
976
977 /**
978 * Subscribes to drawer onPositionChanged event in order to

Callers 1

ngAfterContentInitMethod · 0.95

Calls 3

updateContentMarginsMethod · 0.95
_setContainerClassMethod · 0.95
markForCheckMethod · 0.80

Tested by

no test coverage detected