浏览代码

Remove mode from layout state.

Brian E. Granger 4 年之前
父节点
当前提交
eba3f6cbf7
共有 1 个文件被更改,包括 7 次插入5 次删除
  1. 7 5
      packages/application/src/shell.ts

+ 7 - 5
packages/application/src/shell.ts

@@ -146,7 +146,7 @@ export namespace ILabShell {
     /**
      * The document mode (i.e., multiple/single) of the main dock panel.
      */
-    readonly mode: DockPanel.Mode | null;
+    // readonly mode: DockPanel.Mode | null;
   }
 
   /**
@@ -386,6 +386,7 @@ export class LabShell extends Widget implements JupyterFrontEnd.IShell {
   }
   set mode(mode: DockPanel.Mode) {
     const dock = this._dockPanel;
+    console.log('set mode:', this.mode, mode);
     if (mode === dock.mode) {
       return;
     }
@@ -393,6 +394,7 @@ export class LabShell extends Widget implements JupyterFrontEnd.IShell {
     const applicationCurrentWidget = this.currentWidget;
 
     if (mode === 'single-document') {
+      console.log('siwtchign to single doc mode')
       this._cachedLayout = dock.saveLayout();
       dock.mode = mode;
 
@@ -685,12 +687,12 @@ export class LabShell extends Widget implements JupyterFrontEnd.IShell {
   /**
    * Restore the layout state for the application shell.
    */
-  restoreLayout(layout: ILabShell.ILayout): void {
+  restoreLayout(mode: DockPanel.Mode, layout: ILabShell.ILayout): void {
     const { mainArea, leftArea, rightArea } = layout;
-
+    console.log('mode', mode);
     // Rehydrate the main area.
     if (mainArea) {
-      const { currentWidget, dock, mode } = mainArea;
+      const { currentWidget, dock } = mainArea;
 
       if (dock) {
         this._dockPanel.restoreLayout(dock);
@@ -735,7 +737,7 @@ export class LabShell extends Widget implements JupyterFrontEnd.IShell {
           this.mode === 'single-document'
             ? this._cachedLayout || this._dockPanel.saveLayout()
             : this._dockPanel.saveLayout(),
-        mode: this._dockPanel.mode
+        // mode: this._dockPanel.mode
       },
       leftArea: this._leftHandler.dehydrate(),
       rightArea: this._rightHandler.dehydrate()