Add 'isToggled' check mark on right panel

This commit is contained in:
Nicolas Brichet 2022-08-26 17:26:41 +02:00 committed by foo
parent 069685085b
commit bc67cdc9d1

View File

@ -676,15 +676,31 @@ const sidebarVisibility: JupyterFrontEndPlugin<void> = {
}
},
isToggled: args => {
if (notebookShell.leftCollapsed) {
return false;
}
const currentWidget = notebookShell.leftHandler.current;
if (!currentWidget) {
return false;
}
var currentWidget = null;
switch (args['side'] as string) {
case 'left':
if (notebookShell.leftCollapsed) {
return false;
}
currentWidget = notebookShell.leftHandler.current;
if (!currentWidget) {
return false;
}
return currentWidget.id === (args['id'] as string);
return currentWidget.id === (args['id'] as string);
case 'right':
if (notebookShell.rightCollapsed) {
return false;
}
currentWidget = notebookShell.rightHandler.current;
if (!currentWidget) {
return false;
}
return currentWidget.id === (args['id'] as string);
default:
return false;
}
}
});