Don't always call focus_cell in Cell.command_mode.

The focus_cell should only be called when a user enters
command mode by pressing ESC. Calling focus_cell was causing
jumps when command mode was entered through a mouse click.
Brian E. Granger 13 years ago
parent 9c2762a516
commit 11493ca042

@ -368,14 +368,6 @@ var IPython = (function (IPython) {
return false;
};
CodeCell.prototype.command_mode = function () {
var cont = IPython.Cell.prototype.command_mode.apply(this);
if (cont) {
this.focus_cell();
};
return cont;
}
CodeCell.prototype.edit_mode = function () {
var cont = IPython.Cell.prototype.edit_mode.apply(this);
if (cont) {

@ -131,6 +131,7 @@ var IPython = (function (IPython) {
help : 'command mode',
handler : function (event) {
IPython.notebook.command_mode();
IPython.notebook.focus_cell();
return false;
}
},
@ -138,6 +139,7 @@ var IPython = (function (IPython) {
help : 'command mode',
handler : function (event) {
IPython.notebook.command_mode();
IPython.notebook.focus_cell();
return false;
}
},

@ -547,6 +547,11 @@ var IPython = (function (IPython) {
};
};
Notebook.prototype.focus_cell = function () {
var cell = this.get_selected_cell();
if (cell === null) {return;} // No cell is selected
cell.focus_cell();
};
// Cell movement

@ -204,14 +204,6 @@ var IPython = (function (IPython) {
this.render();
};
TextCell.prototype.command_mode = function () {
var cont = IPython.Cell.prototype.command_mode.apply(this);
if (cont) {
this.focus_cell();
};
return cont;
}
TextCell.prototype.edit_mode = function () {
var cont = IPython.Cell.prototype.edit_mode.apply(this);
if (cont) {

Loading…
Cancel
Save