diff --git a/packages/notebook-extension/src/index.ts b/packages/notebook-extension/src/index.ts index 2b0c369b9c..07025ecdfa 100644 --- a/packages/notebook-extension/src/index.ts +++ b/packages/notebook-extension/src/index.ts @@ -503,20 +503,20 @@ const editNotebookMetadata: JupyterFrontEndPlugin = { const command = 'application:toggle-panel'; const args = { side: 'right', - title: `Show Notebook Tools`, + title: 'Show Notebook Tools', id: 'notebook-tools', - } - + }; + // Check if Show Notebook Tools (Right Sidebar) is open (expanded) - if (!commands.isToggled(command, args)){ - await commands.execute(command, args).then(_ => { + if (!commands.isToggled(command, args)) { + await commands.execute(command, args).then((_) => { // For expanding the 'Advanced Tools' section (default: collapsed) - if (notebookTools){ - let tools = (notebookTools?.layout as any).widgets; + if (notebookTools) { + const tools = (notebookTools?.layout as any).widgets; tools.forEach((tool: any) => { - if (tool.widget.title.label === 'Advanced Tools' && tool.collapsed){ - tool.toggle() + if ( tool.widget.title.label === 'Advanced Tools' && tool.collapsed ){ + tool.toggle(); } }); } @@ -526,7 +526,7 @@ const editNotebookMetadata: JupyterFrontEndPlugin = { }); // Add `Edit Notebook Metadata` option to Edit menu - menu.editMenu.addItem({type: 'command', command: id, rank: 40}) + menu.editMenu.addItem({ type: 'command', command: id, rank: 40 }) }, };