瀏覽代碼

Thread opener into docmanager commands: `tsc` didn't catch this because
`window.opener` exists.

Ian Rose 6 年之前
父節點
當前提交
f357fa278f
共有 1 個文件被更改,包括 12 次插入2 次删除
  1. 12 2
      packages/docmanager-extension/src/index.ts

+ 12 - 2
packages/docmanager-extension/src/index.ts

@@ -135,7 +135,15 @@ const docManagerPlugin: JupyterFrontEndPlugin<IDocumentManager> = {
     });
 
     // Register the file operations commands.
-    addCommands(app, docManager, settingRegistry, labShell, palette, mainMenu);
+    addCommands(
+      app,
+      docManager,
+      opener,
+      settingRegistry,
+      labShell,
+      palette,
+      mainMenu
+    );
 
     // Keep up to date with the settings registry.
     const onSettingsUpdated = (settings: ISettingRegistry.ISettings) => {
@@ -266,6 +274,7 @@ function fileType(widget: Widget, docManager: IDocumentManager): string {
 function addCommands(
   app: JupyterFrontEnd,
   docManager: IDocumentManager,
+  opener: DocumentManager.IWidgetOpener,
   settingRegistry: ISettingRegistry,
   labShell: ILabShell | null,
   palette: ICommandPalette | null,
@@ -293,7 +302,7 @@ function addCommands(
 
   // If inside a rich application like JupyterLab, add additional functionality.
   if (labShell) {
-    addLabCommands(app, docManager, labShell, palette);
+    addLabCommands(app, docManager, labShell, opener, palette);
   }
 
   commands.addCommand(CommandIDs.close, {
@@ -603,6 +612,7 @@ function addLabCommands(
   app: JupyterFrontEnd,
   docManager: IDocumentManager,
   labShell: ILabShell,
+  opener: DocumentManager.IWidgetOpener,
   palette: ICommandPalette | null
 ): void {
   const { commands } = app;