diff --git a/src/assets/wise5/classroomMonitor/classroomMonitorController.ts b/src/assets/wise5/classroomMonitor/classroomMonitorController.ts index c3a1cfc287a..e51f4773e12 100644 --- a/src/assets/wise5/classroomMonitor/classroomMonitorController.ts +++ b/src/assets/wise5/classroomMonitor/classroomMonitorController.ts @@ -104,9 +104,8 @@ class ClassroomMonitorController { icon: 'view_list', type: 'primary', action: () => { - let currentView = this.$state.current.name; - if (currentView === 'root.cm.unit') { - // if we're currently grading a step, close the node when a nodeProgress menu button is clicked + if (this.TeacherDataService.getCurrentNode() !== this.ProjectService.rootNode) { + // we are not showing the root project view so go to the parent of the current node this.NodeService.closeNode(); } }, diff --git a/src/assets/wise5/common/side-menu/side-menu.component.ts b/src/assets/wise5/common/side-menu/side-menu.component.ts index b40cfe3c23f..4d1469fd9b2 100644 --- a/src/assets/wise5/common/side-menu/side-menu.component.ts +++ b/src/assets/wise5/common/side-menu/side-menu.component.ts @@ -15,5 +15,11 @@ export class SideMenuComponent implements OnInit { goToView(view: any): void { this.state.go(view.route); + if (view.action != null) { + // make sure the action is called after this.state.go(view.route) is done changing the route + setTimeout(() => { + view.action(); + }); + } } }