소스 검색

Add check for cell type

Steven Silvester 7 년 전
부모
커밋
0d11345190
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      packages/notebook/src/panel.ts

+ 2 - 1
packages/notebook/src/panel.ts

@@ -193,7 +193,8 @@ class NotebookPanel extends Widget implements DocumentRegistry.IReadyWidget {
     if (!oldValue) {
       newValue.ready.then(() => {
         if (this.notebook.widgets.length === 1) {
-          if (this.notebook.widgets[0].model.value.text === '') {
+          let model = this.notebook.widgets[0].model;
+          if (model.type === 'code' && model.value.text === '') {
             this.notebook.mode = 'edit';
           }
         }