File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change 5959 "command" : " drives:create-new-directory" ,
6060 "selector" : " .jp-DirListing-content" ,
6161 "rank" : 55
62+ },
63+ {
64+ "command" : " notebook:create-new" ,
65+ "selector" : " .jp-DirListing-content" ,
66+ "args" : {
67+ "isContextMenu" : true
68+ },
69+ "disabled" : true
70+ },
71+ {
72+ "command" : " drives:create-new-notebook" ,
73+ "selector" : " .jp-DirListing-content" ,
74+ "rank" : 54
6275 }
6376 ]
6477 },
Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ import {
2424 FilenameSearcher ,
2525 IScore ,
2626 newFolderIcon ,
27- fileIcon
27+ fileIcon ,
28+ notebookIcon
2829} from '@jupyterlab/ui-components' ;
2930import { CommandRegistry } from '@lumino/commands' ;
3031import { Widget } from '@lumino/widgets' ;
@@ -379,7 +380,6 @@ namespace Private {
379380 return browser . model . path !== 's3:' ;
380381 } ,
381382 execute : ( ) => {
382- console . log ( 'NEW COMMAND DIR' ) ;
383383 app . commands . execute ( 'filebrowser:create-new-directory' ) ;
384384 } ,
385385 icon : newFolderIcon . bindprops ( { stylesheet : 'menuItem' } ) ,
@@ -396,5 +396,16 @@ namespace Private {
396396 icon : fileIcon . bindprops ( { stylesheet : 'menuItem' } ) ,
397397 label : 'New File'
398398 } ) ;
399+
400+ app . commands . addCommand ( CommandIDs . createNewNotebook , {
401+ isVisible : ( ) => {
402+ return browser . model . path !== 's3:' ;
403+ } ,
404+ execute : ( ) => {
405+ app . commands . execute ( 'notebook:create-new' ) ;
406+ } ,
407+ icon : notebookIcon . bindprops ( { stylesheet : 'menuItem' } ) ,
408+ label : 'New Notebook'
409+ } ) ;
399410 }
400411}
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export namespace CommandIDs {
1212 export const toggleFileFilter = 'drives:toggle-file-filter' ;
1313 export const createNewDirectory = 'drives:create-new-directory' ;
1414 export const createNewFile = 'drives:create-new-file' ;
15+ export const createNewNotebook = 'drives:create-new-notebook' ;
1516}
1617
1718/**
You can’t perform that action at this time.
0 commit comments