Skip to content

Commit

Permalink
Added Edit Notebook Metadata Option (jupyter#6402)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dilip-Jain authored Oct 9, 2023
1 parent b2e380a commit c597c36
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions packages/notebook-extension/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -503,20 +503,20 @@ const editNotebookMetadata: JupyterFrontEndPlugin<void> = {
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();
}
});
}
Expand All @@ -526,7 +526,7 @@ const editNotebookMetadata: JupyterFrontEndPlugin<void> = {
});

// 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 })
},
};

Expand Down

0 comments on commit c597c36

Please sign in to comment.