Bladeren bron

rebase master

S. Chris Colbert 7 jaren geleden
bovenliggende
commit
aef44c9341
1 gewijzigde bestanden met toevoegingen van 16 en 2 verwijderingen
  1. 16 2
      packages/docregistry/src/default.ts

+ 16 - 2
packages/docregistry/src/default.ts

@@ -573,8 +573,8 @@ class MimeDocumentFactory extends ABCWidgetFactory<MimeDocument, DocumentRegistr
   /**
    * Construct a new markdown widget factory.
    */
-  constructor(options: MimeDocumentFactory.IOptions) {
-    super({ ...options, readOnly: true });
+  constructor(options: MimeRendererFactory.IOptions) {
+    super(Private.createRegistryOptions(options));
     this._rendermime = options.rendermime;
     this._mimeType = options.mimeType;
     this._renderTimeout = options.renderTimeout || 1000;
@@ -649,3 +649,17 @@ namespace MimeDocumentFactory {
     dataType?: 'string' | 'json';
   }
 }
+
+
+/**
+ * The namespace for the module implementation details.
+ */
+namespace Private {
+  /**
+   * Create the document registry options.
+   */
+  export
+  function createRegistryOptions(options: MimeRendererFactory.IOptions): DocumentRegistry.IWidgetFactoryOptions {
+    return { ...options, readOnly: true } as DocumentRegistry.IWidgetFactoryOptions;
+  }
+}