| 91 | readonly cdr = inject(ChangeDetectorRef); |
| 92 | |
| 93 | constructor() { |
| 94 | const dialog = this.dialog; |
| 95 | const doc = inject(DOCUMENT); |
| 96 | |
| 97 | // Possible useful example for the open and closeAll events. |
| 98 | // Adding a class to the body if a dialog opens and |
| 99 | // removing it after all open dialogs are closed |
| 100 | dialog.afterOpened.subscribe(() => { |
| 101 | if (!doc.body.classList.contains('no-scroll')) { |
| 102 | doc.body.classList.add('no-scroll'); |
| 103 | } |
| 104 | }); |
| 105 | dialog.afterAllClosed.subscribe(() => { |
| 106 | doc.body.classList.remove('no-scroll'); |
| 107 | }); |
| 108 | } |
| 109 | |
| 110 | openJazz() { |
| 111 | this.dialogRef = this.dialog.open(JazzDialog, this._getDialogConfig()); |