Skip to content

Commit

Permalink
Activate by default the new created tab in Notebook (assignment list,…
Browse files Browse the repository at this point in the history
… course list and formgrader)
  • Loading branch information
brichet committed Nov 8, 2022
1 parent d90009d commit c4829c3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/assignment_list/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,10 @@ export const assignment_list_extension: JupyterFrontEndPlugin<void> = {

// Attach the widget to the main area if it's not there
if(!widget.isAttached){
if (notebookTree) notebookTree.addWidget(widget);
if (notebookTree){
notebookTree.addWidget(widget);
notebookTree.currentWidget = widget;
}
else app.shell.add(widget, 'main');
}

Expand Down
5 changes: 4 additions & 1 deletion src/course_list/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ export const course_list_extension: JupyterFrontEndPlugin<void> = {

// Attach the widget to the main area if it's not there
if(!widget.isAttached){
if (notebookTree) notebookTree.addWidget(widget);
if (notebookTree){
notebookTree.addWidget(widget);
notebookTree.currentWidget = widget;
}
else app.shell.add(widget, 'main');
}

Expand Down
5 changes: 4 additions & 1 deletion src/formgrader/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ export const formgrader_extension: JupyterFrontEndPlugin<void> = {

// Attach the widget to the main area if it's not there
if(!widget.isAttached){
if (notebookTree) notebookTree.addWidget(widget);
if (notebookTree){
notebookTree.addWidget(widget);
notebookTree.currentWidget = widget;
}
else app.shell.add(widget, 'main');
}

Expand Down

0 comments on commit c4829c3

Please sign in to comment.