Browse Source

Expose context getter on image widget.

Afshin Darian 8 years ago
parent
commit
d32248546c
1 changed files with 10 additions and 3 deletions
  1. 10 3
      src/imagewidget/widget.ts

+ 10 - 3
src/imagewidget/widget.ts

@@ -40,9 +40,16 @@ class ImageWidget extends Widget {
     if (context.model.toString()) {
       this.update();
     }
-    context.pathChanged.connect(() => this.update());
-    context.model.contentChanged.connect(() => this.update());
-    context.fileChanged.connect(() => this.update());
+    context.pathChanged.connect(() => { this.update(); });
+    context.model.contentChanged.connect(() => { this.update(); });
+    context.fileChanged.connect(() => { this.update(); });
+  }
+
+  /**
+   * The image widget's context.
+   */
+  get context(): DocumentRegistry.IContext<DocumentRegistry.IModel> {
+    return this._context;
   }
 
   /**