Skip to content

Commit 61c372d

Browse files
authored
Merge pull request #20 from DenisaCG/fixToolbar
Fix `DriveBrowser` toolbar buttons
2 parents 0467fb1 + d986533 commit 61c372d

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

schema/drives-file-browser.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,31 @@
66
{
77
"name": "new-launcher",
88
"command": "launcher:create",
9+
"label": "",
910
"rank": 1
1011
},
1112
{
1213
"name": "new-directory",
1314
"command": "filebrowser:create-new-directory",
15+
"label": "",
1416
"rank": 10
1517
},
16-
{ "name": "uploader", "rank": 20 },
18+
{ "name": "uploader", "label": "", "rank": 20 },
1719
{
1820
"name": "refresh",
1921
"command": "filebrowser:refresh",
22+
"label": "",
2023
"rank": 30
2124
},
2225
{
2326
"name": "toggle-file-filter",
2427
"command": "filebrowser:toggle-file-filter",
28+
"label": "",
2529
"rank": 40
2630
},
2731
{
2832
"name": "file-name-searcher",
33+
"label": "",
2934
"rank": 50
3035
}
3136
]

src/index.ts

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {
2222
import { ISettingRegistry } from '@jupyterlab/settingregistry';
2323
import { FilenameSearcher, IScore } from '@jupyterlab/ui-components';
2424
import { CommandRegistry } from '@lumino/commands';
25-
import { Panel } from '@lumino/widgets';
2625

2726
import { DriveListModel, DriveListView, IDrive } from './drivelistmanager';
2827
import { 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

Comments
 (0)