Browse Source

Remove calls to tracker.sync.

Afshin Darian 8 years ago
parent
commit
d19b0194ac

+ 2 - 3
src/console/plugin.ts

@@ -159,9 +159,8 @@ function activateConsole(app: JupyterLab, services: IServiceManager, rendermime:
     when: manager.ready
   });
 
-  // Sync tracker and set the source of the code inspector.
-  app.shell.currentChanged.connect((sender, args) => {
-    let widget = tracker.sync(args.newValue);
+  // Set the source of the code inspector.
+  tracker.currentChanged.connect((sender, widget) => {
     if (widget) {
       inspector.source = widget.content.inspectionHandler;
     }

+ 0 - 5
src/editorwidget/plugin.ts

@@ -95,11 +95,6 @@ function activate(app: JupyterLab, registry: IDocumentRegistry, restorer: IInsta
     name: widget => widget.context.path
   });
 
-  // Sync tracker with currently focused widget.
-  app.shell.currentChanged.connect((sender, args) => {
-    tracker.sync(args.newValue);
-  });
-
   factory.widgetCreated.connect((sender, widget) => {
     widget.title.icon = `${PORTRAIT_ICON_CLASS} ${EDITOR_ICON_CLASS}`;
     // Notify the instance tracker if restore data needs to update.

+ 0 - 5
src/imagewidget/plugin.ts

@@ -74,11 +74,6 @@ function activate(app: JupyterLab, registry: IDocumentRegistry, palette: IComman
     name: widget => widget.context.path
   });
 
-  // Sync tracker with currently focused widget.
-  app.shell.currentChanged.connect((sender, args) => {
-    tracker.sync(args.newValue);
-  });
-
   registry.addWidgetFactory(factory);
 
   factory.widgetCreated.connect((sender, widget) => {

+ 1 - 7
src/markdownwidget/plugin.ts

@@ -56,6 +56,7 @@ const plugin: JupyterLabPlugin<void> = {
     });
     const namespace = 'rendered-markdown';
     const tracker = new InstanceTracker<MarkdownWidget>({ namespace });
+    let icon = `${PORTRAIT_ICON_CLASS} ${TEXTEDITOR_ICON_CLASS}`;
 
     // Handle state restoration.
     restorer.restore(tracker, {
@@ -64,13 +65,6 @@ const plugin: JupyterLabPlugin<void> = {
       name: widget => widget.context.path
     });
 
-    let icon = `${PORTRAIT_ICON_CLASS} ${TEXTEDITOR_ICON_CLASS}`;
-
-    // Sync tracker with currently focused widget.
-    app.shell.currentChanged.connect((sender, args) => {
-      tracker.sync(args.newValue);
-    });
-
     factory.widgetCreated.connect((sender, widget) => {
       widget.title.icon = icon;
       // Notify the instance tracker if restore data needs to update.

+ 2 - 3
src/notebook/plugin.ts

@@ -189,9 +189,8 @@ function activateNotebookHandler(app: JupyterLab, registry: IDocumentRegistry, s
     when: services.ready
   });
 
-  // Sync tracker and set the source of the code inspector.
-  app.shell.currentChanged.connect((sender, args) => {
-    let widget = tracker.sync(args.newValue);
+  // Set the source of the code inspector.
+  tracker.currentChanged.connect((sender, widget) => {
     if (widget) {
       inspector.source = widget.content.inspectionHandler;
     }

+ 0 - 5
src/terminal/plugin.ts

@@ -101,11 +101,6 @@ function activate(app: JupyterLab, services: IServiceManager, mainMenu: IMainMen
     name: widget => widget.session && widget.session.name
   });
 
-  // Sync tracker with currently focused widget.
-  app.shell.currentChanged.connect((sender, args) => {
-    tracker.sync(args.newValue);
-  });
-
   // Add terminal commands.
   commands.addCommand(newTerminalId, {
     label: 'New Terminal',