Forráskód Böngészése

Upgrade to phosphor 0.7

Steven Silvester 8 éve
szülő
commit
5859fb51c7
4 módosított fájl, 7 hozzáadás és 10 törlés
  1. 1 1
      package.json
  2. 2 2
      src/application/shell.ts
  3. 2 2
      src/docregistry/registry.ts
  4. 2 5
      src/toolbar/index.ts

+ 1 - 1
package.json

@@ -18,7 +18,7 @@
     "less": "^2.7.1",
     "marked": "^0.3.5",
     "moment": "^2.11.2",
-    "phosphor": "^0.6.1",
+    "phosphor": "^0.7.0",
     "sanitize-html": "^1.12.0",
     "semver": "^5.3.0",
     "simulate-event": "^1.2.0",

+ 2 - 2
src/application/shell.ts

@@ -256,7 +256,7 @@ class ApplicationShell extends Widget {
    */
   activateMain(id: string): void {
     let dock = this._dockPanel;
-    let widget = find(dock.widgets, value => value.id === id);
+    let widget = find(dock.widgets(), value => value.id === id);
     if (widget) {
       dock.activateWidget(widget);
     }
@@ -280,7 +280,7 @@ class ApplicationShell extends Widget {
    * Close all tracked widgets.
    */
   closeAll(): void {
-    each(this._dockPanel.widgets, widget => { widget.close(); });
+    each(this._dockPanel.widgets(), widget => { widget.close(); });
   }
 
   private _topPanel: Panel;

+ 2 - 2
src/docregistry/registry.ts

@@ -6,7 +6,7 @@ import {
 } from '@jupyterlab/services';
 
 import {
-  EmptyIterator, IIterator, each, map
+  IIterator, each, empty, map
 } from 'phosphor/lib/algorithm/iteration';
 
 import {
@@ -400,7 +400,7 @@ class DocumentRegistry {
   widgetExtensions(widgetName: string): IIterator<DocumentRegistry.IWidgetExtension<Widget, DocumentRegistry.IModel>> {
     widgetName = widgetName.toLowerCase();
     if (!(widgetName in this._extenders)) {
-      return EmptyIterator.instance;
+      return empty() as IIterator<DocumentRegistry.IWidgetExtension<Widget, DocumentRegistry.IModel>>;
     }
     return this._extenders[widgetName].iter();
   }

+ 2 - 5
src/toolbar/index.ts

@@ -121,13 +121,10 @@ class Toolbar<T extends Widget> extends Widget {
    * Remove an item in the toolbar by value.
    *
    *  @param name - The name of the widget to remove from the toolbar.
-   *
-   * @returns The index occupied by the item, or `-1` if the item
-   *   was not contained in the toolbar.
    */
-  removeItem(widget: T): number {
+  removeItem(widget: T): void {
     let layout = this.layout as PanelLayout;
-    return layout.removeWidget(widget);
+    layout.removeWidget(widget);
   }
 }