浏览代码

Update FAQ plugin.

Afshin Darian 8 年之前
父节点
当前提交
f33dbbafb3
共有 1 个文件被更改,包括 8 次插入9 次删除
  1. 8 9
      src/faq/plugin.ts

+ 8 - 9
src/faq/plugin.ts

@@ -49,15 +49,14 @@ function activateFAQ(app: JupyterLab, palette: ICommandPalette, linker: ICommand
   const category = 'Help';
   const command = 'faq-jupyterlab:show';
   const model = new FaqModel();
-  const tracker = new InstanceTracker<FaqWidget>({
-    restore: {
-      state, layout, command,
-      args: widget => null,
-      name: widget => 'faq',
-      namespace: 'faq',
-      when: app.started,
-      registry: app.commands
-    }
+  const tracker = new InstanceTracker<FaqWidget>();
+
+  // Handle state restoration.
+  layout.restore(tracker, {
+    namespace: 'faq',
+    command,
+    args: widget => null,
+    name: widget => 'faq'
   });
 
   let widget: FaqWidget;