From c597c3602d79589af593d13a90e75f8727f06fb1 Mon Sep 17 00:00:00 2001 From: Dilip-Jain <59838651+Dilip-Jain@users.noreply.github.com> Date: Mon, 9 Oct 2023 22:22:20 +0530 Subject: [PATCH] Added Edit Notebook Metadata Option (#6402) --- packages/notebook-extension/src/index.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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 }) }, };