File tree Expand file tree Collapse file tree 1 file changed +21
-19
lines changed Expand file tree Collapse file tree 1 file changed +21
-19
lines changed Original file line number Diff line number Diff line change @@ -138,24 +138,26 @@ export const notebookPlugin: JupyterFrontEndPlugin<void> = {
138138 app . shell . activateById ( sidebarItem . id ) ;
139139 app . restored . then ( ( ) => app . shell . activateById ( sidebarItem . id ) ) ;
140140
141- toolbarRegistry . addFactory (
142- 'Notebook' ,
143- 'downloadDropdown' ,
144- ( ) => new DownloadDropdownButton ( commands )
145- ) ;
146-
147- toolbarRegistry . addFactory (
148- 'Notebook' ,
149- 'share' ,
150- ( ) =>
151- new ToolbarButton ( {
152- label : 'Share' ,
153- icon : EverywhereIcons . link ,
154- tooltip : 'Share this notebook' ,
155- onClick : ( ) => {
156- void commands . execute ( Commands . shareNotebookCommand ) ;
157- }
158- } )
159- ) ;
141+ for ( const toolbarName of [ 'Notebook' , 'ViewOnlyNotebook' ] ) {
142+ toolbarRegistry . addFactory (
143+ toolbarName ,
144+ 'downloadDropdown' ,
145+ ( ) => new DownloadDropdownButton ( commands )
146+ ) ;
147+
148+ toolbarRegistry . addFactory (
149+ toolbarName ,
150+ 'share' ,
151+ ( ) =>
152+ new ToolbarButton ( {
153+ label : 'Share' ,
154+ icon : EverywhereIcons . link ,
155+ tooltip : 'Share this notebook' ,
156+ onClick : ( ) => {
157+ void commands . execute ( Commands . shareNotebookCommand ) ;
158+ }
159+ } )
160+ ) ;
161+ }
160162 }
161163} ;
You can’t perform that action at this time.
0 commit comments