From 79eb383b28734a85c7b37cadd98dee7f17921e82 2012-01-25 22:03:49 From: Brian Granger Date: 2012-01-25 22:03:49 Subject: [PATCH] Removing extra refresh that is no longer needed because of CM fix. --- diff --git a/IPython/frontend/html/notebook/static/js/codecell.js b/IPython/frontend/html/notebook/static/js/codecell.js index efcd422..9cf29bd 100644 --- a/IPython/frontend/html/notebook/static/js/codecell.js +++ b/IPython/frontend/html/notebook/static/js/codecell.js @@ -530,11 +530,11 @@ var IPython = (function (IPython) { CodeCell.prototype.select = function () { 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.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. }; diff --git a/IPython/frontend/html/notebook/static/js/textcell.js b/IPython/frontend/html/notebook/static/js/textcell.js index 07dd4c8..7c2d9bc 100644 --- a/IPython/frontend/html/notebook/static/js/textcell.js +++ b/IPython/frontend/html/notebook/static/js/textcell.js @@ -96,14 +96,11 @@ var IPython = (function (IPython) { var output = text_cell.find("div.text_cell_render"); output.hide(); 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.focus(); - // This final refresh is needed on Firefox to trigger the editor - // to be auto-sized. This glitch only happens on cell that are - // loaded initially and haven't had their editor focused before. - 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. this.rendered = false; if (this.get_text() === this.placeholder) { this.set_text('');