Show More
@@ -116,7 +116,7 var IPython = (function (IPython) { | |||
|
116 | 116 | }); |
|
117 | 117 | |
|
118 | 118 | $([IPython.events]).on('edit_mode.Cell', function (event, data) { |
|
119 |
that.edit_mode( |
|
|
119 | that.edit_mode(that.find_cell_index(data.cell), false); | |
|
120 | 120 | }); |
|
121 | 121 | |
|
122 | 122 | $([IPython.events]).on('command_mode.Cell', function (event, data) { |
@@ -543,11 +543,11 var IPython = (function (IPython) { | |||
|
543 | 543 | * Make the notebook enter edit mode. |
|
544 | 544 | * |
|
545 | 545 | * @method edit_mode |
|
546 | * @param [focust_editor] {bool} Should this method focus the cell's editor? Defaults to true. | |
|
547 | 546 | * @param [index] {int} Cell index to select. If no index is provided, |
|
548 | 547 | * the current selected cell is used. |
|
548 | * @param [focust_editor] {bool} Should this method focus the cell's editor? Defaults to true. | |
|
549 | 549 | **/ |
|
550 |
Notebook.prototype.edit_mode = function ( |
|
|
550 | Notebook.prototype.edit_mode = function (index, focus_editor) { | |
|
551 | 551 | if (focus_editor===undefined) { |
|
552 | 552 | focus_editor = true; |
|
553 | 553 | } |
@@ -1458,14 +1458,14 var IPython = (function (IPython) { | |||
|
1458 | 1458 | // If we are at the end always insert a new cell and return |
|
1459 | 1459 | if (cell_index === (this.ncells()-1)) { |
|
1460 | 1460 | this.insert_cell_below('code'); |
|
1461 |
this.edit_mode( |
|
|
1461 | this.edit_mode(cell_index+1, true); | |
|
1462 | 1462 | this.scroll_to_bottom(); |
|
1463 | 1463 | this.set_dirty(true); |
|
1464 | 1464 | return; |
|
1465 | 1465 | } |
|
1466 | 1466 | |
|
1467 | 1467 | this.insert_cell_below('code'); |
|
1468 |
this.edit_mode( |
|
|
1468 | this.edit_mode(cell_index+1, true); | |
|
1469 | 1469 | this.set_dirty(true); |
|
1470 | 1470 | }; |
|
1471 | 1471 | |
@@ -1484,7 +1484,7 var IPython = (function (IPython) { | |||
|
1484 | 1484 | // If we are at the end always insert a new cell and return |
|
1485 | 1485 | if (cell_index === (this.ncells()-1)) { |
|
1486 | 1486 | this.insert_cell_below('code'); |
|
1487 |
this.edit_mode( |
|
|
1487 | this.edit_mode(cell_index+1, true); | |
|
1488 | 1488 | this.scroll_to_bottom(); |
|
1489 | 1489 | this.set_dirty(true); |
|
1490 | 1490 | return; |
@@ -1960,7 +1960,7 var IPython = (function (IPython) { | |||
|
1960 | 1960 | console.log('load notebook success'); |
|
1961 | 1961 | if (this.ncells() === 0) { |
|
1962 | 1962 | this.insert_cell_below('code'); |
|
1963 |
this.edit_mode( |
|
|
1963 | this.edit_mode(0, true); | |
|
1964 | 1964 | } else { |
|
1965 | 1965 | this.select(0); |
|
1966 | 1966 | this.command_mode(); |
General Comments 0
You need to be logged in to leave comments.
Login now