@@ -22,7 +22,6 @@ import {
2222import { ISettingRegistry } from '@jupyterlab/settingregistry' ;
2323import { FilenameSearcher , IScore } from '@jupyterlab/ui-components' ;
2424import { CommandRegistry } from '@lumino/commands' ;
25- import { Panel } from '@lumino/widgets' ;
2625
2726import { DriveListModel , DriveListView , IDrive } from './drivelistmanager' ;
2827import { DriveIcon , driveBrowserIcon } from './icons' ;
@@ -203,9 +202,17 @@ const driveFileBrowser: JupyterFrontEndPlugin<void> = {
203202 // Set attributes when adding the browser to the UI
204203 driveBrowser . node . setAttribute ( 'role' , 'region' ) ;
205204 driveBrowser . node . setAttribute ( 'aria-label' , 'Drive Browser Section' ) ;
205+ driveBrowser . title . icon = driveBrowserIcon ;
206+ driveBrowser . title . caption = 'Drive File Browser' ;
207+ driveBrowser . id = 'Drive-File-Browser' ;
206208
207209 void Private . restoreBrowser ( driveBrowser , commands , router , tree , labShell ) ;
208210
211+ app . shell . add ( driveBrowser , 'left' , { rank : 102 , type : 'File Browser' } ) ;
212+ if ( restorer ) {
213+ restorer . add ( driveBrowser , 'drive-file-browser' ) ;
214+ }
215+
209216 toolbarRegistry . addFactory (
210217 FILE_BROWSER_FACTORY ,
211218 'uploader' ,
@@ -246,19 +253,6 @@ const driveFileBrowser: JupyterFrontEndPlugin<void> = {
246253 translator
247254 )
248255 ) ;
249-
250- // instate Drive Browser Panel
251- const drivePanel = new Panel ( ) ;
252- drivePanel . title . icon = driveBrowserIcon ;
253- drivePanel . title . iconClass = 'jp-sideBar-tabIcon' ;
254- drivePanel . title . caption = 'Drive File Browser' ;
255- drivePanel . id = 'Drive-Browser-Panel' ;
256-
257- app . shell . add ( drivePanel , 'left' , { rank : 102 , type : 'File Browser' } ) ;
258- drivePanel . addWidget ( driveBrowser ) ;
259- if ( restorer ) {
260- restorer . add ( drivePanel , 'drive-sidepanel' ) ;
261- }
262256 }
263257} ;
264258
0 commit comments