Fix the sidebar closing if another widget is selected in the same sidebar

Nicolas Brichet 3 years ago committed by foo
parent 1773c8fb26
commit 069685085b

@ -651,7 +651,9 @@ const sidebarVisibility: JupyterFrontEndPlugin<void> = {
switch (args['side'] as string) {
case 'left':
if (notebookShell.leftCollapsed) {
notebookShell.activateById(args['id'] as string);
notebookShell.expandLeft(args.id as string);
} else if (notebookShell.leftHandler.current?.id !== args.id) {
notebookShell.expandLeft(args.id as string);
} else {
notebookShell.collapseLeft();
if (notebookShell.currentWidget) {
@ -661,7 +663,9 @@ const sidebarVisibility: JupyterFrontEndPlugin<void> = {
break;
case 'right':
if (notebookShell.rightCollapsed) {
notebookShell.activateById(args['id'] as string);
notebookShell.expandRight(args.id as string);
} else if (notebookShell.rightHandler.current?.id !== args.id) {
notebookShell.expandRight(args.id as string);
} else {
notebookShell.collapseRight();
if (notebookShell.currentWidget) {

@ -209,17 +209,9 @@ export class NotebookShell extends Widget implements JupyterFrontEnd.IShell {
const widget = find(this.widgets(area), w => w.id === id);
if (widget) {
if (area === 'left') {
if (this.leftCollapsed) {
this.expandLeft(id);
} else {
this.collapseLeft();
}
this.expandLeft(id);
} else if (area === 'right') {
if (this.rightCollapsed) {
this.expandRight(id);
} else {
this.collapseRight();
}
this.expandRight(id);
} else {
widget.activate();
}
@ -628,6 +620,9 @@ namespace Private {
* if there is no most recently used.
*/
expand(id?: string): void {
if (this._current) {
this.collapse();
}
if (id) {
this.activate(id);
} else {

Loading…
Cancel
Save