Browse Source

Bug fix: setting relative sizes on load was still wonky.

Afshin Darian 7 years ago
parent
commit
bac5c0852b
1 changed files with 13 additions and 4 deletions
  1. 13 4
      packages/settingeditor-extension/src/settingeditor.ts

+ 13 - 4
packages/settingeditor-extension/src/settingeditor.ts

@@ -32,6 +32,16 @@ import {
 } from '@phosphor/widgets';
 
 
+/**
+ * The ratio panes in the plugin editor.
+ */
+const DEFAULT_INNER = [5, 2];
+
+/**
+ * The ratio panes in the setting editor.
+ */
+const DEFAULT_OUTER = [1, 3];
+
 /**
  * The class name added to all setting editors.
  */
@@ -216,7 +226,6 @@ class SettingEditor extends Widget {
 
     const { key, state } = this;
     const editor = this._editor;
-    const panel = this._panel;
 
     return this._fetching = state.fetch(key).then(saved => {
       this._fetching = null;
@@ -225,8 +234,8 @@ class SettingEditor extends Widget {
         return;
       }
 
-      const inner = editor.sizes;
-      const outer = panel.relativeSizes();
+      const inner = DEFAULT_INNER;
+      const outer = DEFAULT_OUTER;
       const plugin = editor.settings ? editor.settings.plugin : '';
 
       if (!saved) {
@@ -346,7 +355,7 @@ class SettingEditor extends Widget {
   private _instructions: Widget;
   private _list: PluginList;
   private _panel: SplitPanel;
-  private _presets = { inner: [5, 2], outer: [1, 3], plugin: '' };
+  private _presets = { inner: DEFAULT_INNER, outer: DEFAULT_OUTER, plugin: '' };
   private _saving = false;
 }