From 0f1c4d7113a093e5db559dbd7c213e2630407361 Mon Sep 17 00:00:00 2001 From: Scott Berg <saberg3@wisc.edu> Date: Mon, 13 May 2019 11:51:26 -0500 Subject: [PATCH] Add closeOnNavigation to all dialogs. --- src/app/app.component.ts | 1 + src/app/core/navigation/navigation.component.ts | 4 +++- .../shared/course-item/course-item.component.ts | 1 + .../degree-planner/term-container/term-container.component.ts | 3 ++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 1f9a59c..f00fbf8 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -58,6 +58,7 @@ export class AppComponent implements OnInit { .subscribe(courseDetails => { this.dialog.open(CourseDetailsDialogComponent, { data: { courseDetails: courseDetails }, + closeOnNavigation: true, }); }); } diff --git a/src/app/core/navigation/navigation.component.ts b/src/app/core/navigation/navigation.component.ts index caac258..7fad9c3 100644 --- a/src/app/core/navigation/navigation.component.ts +++ b/src/app/core/navigation/navigation.component.ts @@ -13,6 +13,8 @@ export class NavigationComponent { constructor(public dialog: MatDialog) {} public onFeedbackClick() { - this.dialog.open(FeedbackDialogComponent); + this.dialog.open(FeedbackDialogComponent, { + closeOnNavigation: true, + }); } } diff --git a/src/app/degree-planner/shared/course-item/course-item.component.ts b/src/app/degree-planner/shared/course-item/course-item.component.ts index 27fd3b2..18fe4f9 100644 --- a/src/app/degree-planner/shared/course-item/course-item.component.ts +++ b/src/app/degree-planner/shared/course-item/course-item.component.ts @@ -323,6 +323,7 @@ export class CourseItemComponent implements OnInit { width: '80%', panelClass: this.mobileView.matches ? 'dialog-fullscreen' : '', data: { courseDetails: courseDetails, courseType: this.type }, + closeOnNavigation: true, }); }); } diff --git a/src/app/degree-planner/term-container/term-container.component.ts b/src/app/degree-planner/term-container/term-container.component.ts index 5fa568d..0935210 100644 --- a/src/app/degree-planner/term-container/term-container.component.ts +++ b/src/app/degree-planner/term-container/term-container.component.ts @@ -150,6 +150,7 @@ export class TermContainerComponent implements OnInit, OnDestroy { termName: curr.termCode.termName, maxCredits: maxAllowedCredits, }, + closeOnNavigation: true, }); }); } @@ -192,7 +193,7 @@ export class TermContainerComponent implements OnInit, OnDestroy { noteId: note.id, } : { termCode, hasExistingNote: false }; - this.dialog.open(NotesDialogComponent, { data }); + this.dialog.open(NotesDialogComponent, { data, closeOnNavigation: true }); } } -- GitLab