浏览代码

Merge branch 'createnewcellview' of github.com:jasongrout/jupyterlab into createnewcellview

Jason Grout 7 年之前
父节点
当前提交
db8f050687
共有 1 个文件被更改,包括 14 次插入3 次删除
  1. 14 3
      packages/cells/src/widget.ts

+ 14 - 3
packages/cells/src/widget.ts

@@ -314,7 +314,7 @@ class Cell extends Widget {
   /**
    * Clone the cell, using the same model.
    */
-  clone() {
+  clone(): Cell {
     let constructor = this.constructor as typeof Cell;
     return new constructor({
       model: this.model,
@@ -623,7 +623,7 @@ class CodeCell extends Cell {
   /**
    * Clone the cell, using the same model.
    */
-  clone() {
+  clone(): CodeCell {
     let constructor = this.constructor as typeof CodeCell;
     return new constructor({
       model: this.model,
@@ -875,7 +875,7 @@ class MarkdownCell extends Cell {
   /**
    * Clone the cell, using the same model.
    */
-  clone() {
+  clone(): MarkdownCell {
     let constructor = this.constructor as typeof MarkdownCell;
     return new constructor({
       model: this.model,
@@ -935,6 +935,17 @@ class RawCell extends Cell {
     this.addClass(RAW_CELL_CLASS);
   }
 
+  /**
+   * Clone the cell, using the same model.
+   */
+  clone(): RawCell {
+    let constructor = this.constructor as typeof RawCell;
+    return new constructor({
+      model: this.model,
+      contentFactory: this.contentFactory
+    });
+  }
+
   /**
    * The model used by the widget.
    */