Removing extra refresh that is no longer needed because of CM fix.

This commit is contained in:
Brian Granger 2012-01-25 14:03:49 -08:00
parent 262d73f652
commit 0bc0c560aa
2 changed files with 6 additions and 9 deletions

View File

@ -530,11 +530,11 @@ var IPython = (function (IPython) {
CodeCell.prototype.select = function () { CodeCell.prototype.select = function () {
IPython.Cell.prototype.select.apply(this); IPython.Cell.prototype.select.apply(this);
// In some cases (inserting a new cell) we need a refresh before and
// after the focus. Not sure why this is the case.
this.code_mirror.refresh(); this.code_mirror.refresh();
this.code_mirror.focus(); this.code_mirror.focus();
this.code_mirror.refresh(); // We used to need an additional refresh() after the focus, but
// it appears that this has been fixed in CM. This bug would show
// up on FF when a newly loaded markdown cell was edited.
}; };

View File

@ -96,14 +96,11 @@ var IPython = (function (IPython) {
var output = text_cell.find("div.text_cell_render"); var output = text_cell.find("div.text_cell_render");
output.hide(); output.hide();
text_cell.find('div.text_cell_input').show(); text_cell.find('div.text_cell_input').show();
// I don't know why I need to do this, but if I don't do
// refresh/focus/refresh, the to_markdown method won't work.
this.code_mirror.refresh(); this.code_mirror.refresh();
this.code_mirror.focus(); this.code_mirror.focus();
// This final refresh is needed on Firefox to trigger the editor // We used to need an additional refresh() after the focus, but
// to be auto-sized. This glitch only happens on cell that are // it appears that this has been fixed in CM. This bug would show
// loaded initially and haven't had their editor focused before. // up on FF when a newly loaded markdown cell was edited.
this.code_mirror.refresh();
this.rendered = false; this.rendered = false;
if (this.get_text() === this.placeholder) { if (this.get_text() === this.placeholder) {
this.set_text(''); this.set_text('');