Steven Silvester 8 năm trước cách đây
mục cha
commit
272c999a14
1 tập tin đã thay đổi với 8 bổ sung17 xóa
  1. 8 17
      packages/launcher-extension/src/index.ts

+ 8 - 17
packages/launcher-extension/src/index.ts

@@ -57,29 +57,20 @@ function activate(app: JupyterLab, services: IServiceManager, palette: ICommandP
   const { commands, shell } = app;
 
   let model = new LauncherModel();
-  let widget = new LauncherWidget({ linker });
-
-  widget.model = model;
-  widget.id = 'launcher';
-  widget.title.label = 'Launcher';
-
-  // Let the application restorer track the launcher for restoration of
-  // application state (e.g. setting the launcher as the current side bar
-  // widget).
-  restorer.add(widget, 'launcher');
 
   commands.addCommand(CommandIDs.show, {
-    label: 'Show Launcher',
+    label: 'New Launcher',
     execute: () => {
-      if (!widget.isAttached) {
-        shell.addToLeftArea(widget);
-      }
-      shell.activateById(widget.id);
+      let widget = new LauncherWidget({ linker });
+
+      widget.model = model;
+      widget.id = 'launcher';
+      widget.title.label = 'Launcher';
+      shell.addToMainArea(widget);
     }
   });
-  palette.addItem({ command: CommandIDs.show, category: 'Help' });
 
-  shell.addToLeftArea(widget);
+  palette.addItem({ command: CommandIDs.show, category: 'Launcher'});
 
   return model;
 }