From 49639e8baaa11ad1c4e75071a213d1c6998f7cec 2014-03-09 18:41:25 From: Paul Ivanov Date: 2014-03-09 18:41:25 Subject: [PATCH] remove raw cell placeholder on focus, closes #5238 --- diff --git a/IPython/html/static/notebook/js/textcell.js b/IPython/html/static/notebook/js/textcell.js index 4eab761..f44affc 100644 --- a/IPython/html/static/notebook/js/textcell.js +++ b/IPython/html/static/notebook/js/textcell.js @@ -390,6 +390,8 @@ var IPython = (function (IPython) { this.element.focusout(function() { that.auto_highlight(); }); + + this.code_mirror.on('focus', function() { that.unrender(); }); }; /** @@ -402,13 +404,13 @@ var IPython = (function (IPython) { /** @method render **/ RawCell.prototype.render = function () { - // Make sure that this cell type can never be rendered - if (this.rendered) { - this.unrender(); + var cont = IPython.TextCell.prototype.render.apply(this); + if (cont){ + var text = this.get_text(); + if (text === "") { text = this.placeholder; } + this.set_text(text); } - var text = this.get_text(); - if (text === "") { text = this.placeholder; } - this.set_text(text); + return cont; };