Selaa lähdekoodia

Fixes to get example working again

Steven Silvester 9 vuotta sitten
vanhempi
commit
578fee8e8e

+ 3 - 1
src/notebook/cells/model.ts

@@ -427,7 +427,9 @@ class CodeCellModel extends BaseCellModel implements ICodeCellModel {
     this.collapsed = data.metadata.collapsed;
     this.scrolled = data.metadata.scrolled;
     this.executionCount = data.execution_count;
-    this.output.add.apply(null, data.outputs);
+    for (let i = 0; i < data.outputs.length; i++) {
+      this.output.add(data.outputs[i]);
+    }
   }
 
   type: CellType = "code";

+ 2 - 2
src/notebook/cells/widget.ts

@@ -182,7 +182,7 @@ class MarkdownCellWidget extends BaseCellWidget {
     this.addClass(MARKDOWN_CELL_CLASS);
     // Insist on the Github-flavored markdown mode.
     model.input.textEditor.mimetype = 'text/x-ipythongfm';
-    this.rendered = new Widget();
+    this._rendered = new Widget();
     this.update();
   }
 
@@ -235,7 +235,7 @@ class MarkdownCellWidget extends BaseCellWidget {
   }
 
   private _rendered: Widget;
-  private _dirty: boolean;
+  private _dirty = true;
 }
 
 

+ 1 - 1
src/notebook/notebook/model.ts

@@ -397,7 +397,7 @@ class NotebookModel implements INotebookModel {
       if (isMarkdownCell(c)) {
         cell = this.createMarkdownCell();
       } else if (isCodeCell(c)) {
-        let cell = this.createCodeCell();
+        cell = this.createCodeCell();
       } else if (isRawCell(c)) {
         cell = this.createRawCell();
       }

+ 1 - 1
src/notebook/output-area/widget.ts

@@ -228,7 +228,7 @@ class OutputAreaWidget extends Widget {
       break;
     case ListChangeType.Replace:
       for (let i = layout.childCount(); i > 0; i--) {
-        widget = layout.childAt(i);
+        widget = layout.childAt(i - 1);
         layout.removeChild(widget);
         widget.dispose();
       }

+ 7 - 7
src/notebook/theme.css

@@ -34,7 +34,7 @@
 }
 
 
-.jp-OutputArea-Stderr {
+.jp-OutputArea-stderr {
   background: #fdd;
 }
 
@@ -64,7 +64,7 @@
 }
 
 
-.CodeMirror.cm-s-default {
+.jp-InputArea.CodeMirror.cm-s-default {
   line-height: 1.21429em;
   /* Changed from 1em to our global default */
   font-size: 14px;
@@ -75,7 +75,7 @@
 }
 
 
-.CodeMirror-scroll {
+.jp-InputArea.CodeMirror-scroll {
   /*  The CodeMirror docs are a bit fuzzy on if overflow-y should be hidden or visible.*/
   /*  We have found that if it is visible, vertical scrollbars appear with font size changes.*/
   overflow-y: hidden;
@@ -83,26 +83,26 @@
 }
 
 
-.CodeMirror-lines {
+.jp-InputArea.CodeMirror-lines {
   /* In CM2, this used to be 0.4em, but in CM3 it went to 4px. We need the em value because */
   /* we have set a different line-height and want this to scale with that. */
   padding: 0.4em;
 }
 
 
-.CodeMirror-linenumber {
+.jp-InputArea.CodeMirror-linenumber {
   padding: 0 8px 0 4px;
 }
 
 
 
-.CodeMirror-gutters {
+.jp-InputArea.CodeMirror-gutters {
   border-bottom-left-radius: 2px;
   border-top-left-radius: 2px;
 }
 
 
-.CodeMirror pre {
+.jp-InputArea.CodeMirror pre {
   /* In CM3 this went to 4px from 0 in CM2. We need the 0 value because of how we size */
   /* .CodeMirror-lines */
   padding: 0;