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