浏览代码

Require activate to be called explicitly.

Afshin Darian 8 年之前
父节点
当前提交
2775d7e768
共有 7 个文件被更改,包括 6 次插入9 次删除
  1. 1 2
      src/about/plugin.ts
  2. 0 1
      src/application/shell.ts
  3. 1 0
      src/console/plugin.ts
  4. 1 2
      src/faq/plugin.ts
  5. 0 2
      src/inspector/plugin.ts
  6. 2 2
      src/landing/plugin.ts
  7. 1 0
      src/terminal/plugin.ts

+ 1 - 2
src/about/plugin.ts

@@ -44,9 +44,8 @@ function activateAbout(app: JupyterLab, palette: ICommandPalette): void {
     execute: () => {
       if (!widget.isAttached) {
         app.shell.addToMainArea(widget);
-      } else {
-        app.shell.activateMain(widget.id);
       }
+      app.shell.activateMain(widget.id);
     }
   });
   palette.addItem({ command, category: 'Help' });

+ 0 - 1
src/application/shell.ts

@@ -234,7 +234,6 @@ class ApplicationShell extends Widget {
       return;
     }
     this._dockPanel.addWidget(widget, { mode: 'tab-after' });
-    this._dockPanel.activateWidget(widget);
   }
 
   /**

+ 1 - 0
src/console/plugin.ts

@@ -347,6 +347,7 @@ function activateConsole(app: JupyterLab, services: IServiceManager, rendermime:
     panel.title.icon = `${LANDSCAPE_ICON_CLASS} ${CONSOLE_ICON_CLASS}`;
     panel.title.closable = true;
     app.shell.addToMainArea(panel);
+    app.shell.activateMain(panel.id);
     // Update the caption of the tab with the last execution time.
     panel.content.executed.connect((sender, executed) => {
       captionOptions.executed = executed;

+ 1 - 2
src/faq/plugin.ts

@@ -333,9 +333,8 @@ function activateFAQ(app: JupyterLab, palette: ICommandPalette): void {
     execute: () => {
       if (!widget.isAttached) {
         app.shell.addToMainArea(widget);
-      } else {
-        app.shell.activateMain(widget.id);
       }
+      app.shell.activateMain(widget.id);
     }
   });
 

+ 0 - 2
src/inspector/plugin.ts

@@ -105,11 +105,9 @@ function activateInspector(app: JupyterLab, palette: ICommandPalette): IInspecto
     if (!manager.inspector || manager.inspector.isDisposed) {
       manager.inspector = newInspector();
       app.shell.addToMainArea(manager.inspector);
-      return;
     }
     if (manager.inspector.isAttached) {
       app.shell.activateMain(manager.inspector.id);
-      return;
     }
   }
 

+ 2 - 2
src/landing/plugin.ts

@@ -139,9 +139,8 @@ function activateLanding(app: JupyterLab, services: IServiceManager, pathTracker
     execute: () => {
       if (!widget.isAttached) {
         app.shell.addToMainArea(widget);
-      } else {
-        app.shell.activateMain(widget.id);
       }
+      app.shell.activateMain(widget.id);
     }
   });
 
@@ -151,4 +150,5 @@ function activateLanding(app: JupyterLab, services: IServiceManager, pathTracker
   });
 
   app.shell.addToMainArea(widget);
+  app.shell.activateMain(widget.id);
 }

+ 1 - 0
src/terminal/plugin.ts

@@ -89,6 +89,7 @@ function activateTerminal(app: JupyterLab, services: IServiceManager, mainMenu:
       term.title.closable = true;
       term.title.icon = `${LANDSCAPE_ICON_CLASS} ${TERMINAL_ICON_CLASS}`;
       app.shell.addToMainArea(term);
+      app.shell.activateMain(term.id);
       tracker.add(term);
       let promise: Promise<TerminalSession.ISession>;
       if (name) {