浏览代码

Merge pull request #2216 from blink1073/scroll-to-cell-fix

Only auto-scroll when running cells
Afshin Darian 8 年之前
父节点
当前提交
7ba2dd9c22
共有 2 个文件被更改,包括 0 次插入12 次删除
  1. 0 5
      packages/notebook/src/actions.ts
  2. 0 7
      packages/notebook/src/widget.ts

+ 0 - 5
packages/notebook/src/actions.ts

@@ -22,10 +22,6 @@ import {
   ArrayExt, each, toArray
 } from '@phosphor/algorithm';
 
-import {
-  ElementExt
-} from '@phosphor/domutils';
-
 import {
   INotebookModel
 } from './model';
@@ -851,7 +847,6 @@ namespace Private {
     if (state.wasFocused || widget.mode === 'edit') {
       widget.activate();
     }
-    ElementExt.scrollIntoViewIfNeeded(widget.node, widget.activeCell.node);
   }
 
   /**

+ 0 - 7
packages/notebook/src/widget.ts

@@ -9,10 +9,6 @@ import {
   JSONValue
 } from '@phosphor/coreutils';
 
-import {
-  ElementExt
-} from '@phosphor/domutils';
-
 import {
   Message
 } from '@phosphor/messaging';
@@ -654,8 +650,6 @@ class Notebook extends StaticNotebook {
     this._mode = newValue;
 
     if (newValue === 'edit') {
-      ElementExt.scrollIntoViewIfNeeded(this.node, this.activeCell.node);
-
       // Edit mode deselects all cells.
       each(this.widgets, widget => { this.deselect(widget); });
       //  Edit mode unrenders an active markdown widget.
@@ -1328,7 +1322,6 @@ class Notebook extends StaticNotebook {
       let node = widget.editorWidget.node;
       if (node.contains(target)) {
         this.mode = 'edit';
-        ElementExt.scrollIntoViewIfNeeded(this.node, widget.node);
       }
     } else {
       // No cell has focus, ensure command mode.