Skip to content

Commit c4829c3

Browse files
committed
Activate by default the new created tab in Notebook (assignment list, course list and formgrader)
1 parent d90009d commit c4829c3

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

src/assignment_list/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,10 @@ export const assignment_list_extension: JupyterFrontEndPlugin<void> = {
210210

211211
// Attach the widget to the main area if it's not there
212212
if(!widget.isAttached){
213-
if (notebookTree) notebookTree.addWidget(widget);
213+
if (notebookTree){
214+
notebookTree.addWidget(widget);
215+
notebookTree.currentWidget = widget;
216+
}
214217
else app.shell.add(widget, 'main');
215218
}
216219

src/course_list/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,10 @@ export const course_list_extension: JupyterFrontEndPlugin<void> = {
139139

140140
// Attach the widget to the main area if it's not there
141141
if(!widget.isAttached){
142-
if (notebookTree) notebookTree.addWidget(widget);
142+
if (notebookTree){
143+
notebookTree.addWidget(widget);
144+
notebookTree.currentWidget = widget;
145+
}
143146
else app.shell.add(widget, 'main');
144147
}
145148

src/formgrader/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ export const formgrader_extension: JupyterFrontEndPlugin<void> = {
9898

9999
// Attach the widget to the main area if it's not there
100100
if(!widget.isAttached){
101-
if (notebookTree) notebookTree.addWidget(widget);
101+
if (notebookTree){
102+
notebookTree.addWidget(widget);
103+
notebookTree.currentWidget = widget;
104+
}
102105
else app.shell.add(widget, 'main');
103106
}
104107

0 commit comments

Comments
 (0)