浏览代码

Add a comment

Steven Silvester 9 年之前
父节点
当前提交
3aeb9f3d2f
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/notebook/notebook/widget.ts

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

@@ -796,6 +796,8 @@ class Notebook extends StaticNotebook {
    * Handle a new model.
    */
   protected onModelChanged(oldValue: INotebookModel, newValue: INotebookModel): void {
+    // Try to set the active cell index to 0.
+    // It will be set to `-1` if there is no new model or the model is empty.
     this.activeCellIndex = 0;
   }