From 244ed795d36f97e7b0fa22090ea200ccad5abbdf Mon Sep 17 00:00:00 2001 From: Brian Granger Date: Mon, 23 Jan 2012 11:56:07 -0800 Subject: [PATCH] Adding refresh/focus/refresh back to edit to fix bug in FF. --- IPython/frontend/html/notebook/static/js/textcell.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/IPython/frontend/html/notebook/static/js/textcell.js b/IPython/frontend/html/notebook/static/js/textcell.js index eb8bdbfe3..07dd4c800 100644 --- a/IPython/frontend/html/notebook/static/js/textcell.js +++ b/IPython/frontend/html/notebook/static/js/textcell.js @@ -100,8 +100,10 @@ var IPython = (function (IPython) { // refresh/focus/refresh, the to_markdown method won't work. this.code_mirror.refresh(); this.code_mirror.focus(); - // In some wierd cases we seem to need this extra refresh. - //this.code_mirror.refresh(); + // 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(); this.rendered = false; if (this.get_text() === this.placeholder) { this.set_text('');