Skip to content

Commit

Permalink
remove raw cell placeholder on focus, closes ipython#5238
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanov authored and Zaharid committed Apr 22, 2014
1 parent a152603 commit b4533ec
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions IPython/html/static/notebook/js/textcell.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ var IPython = (function (IPython) {
this.element.focusout(function() {
that.auto_highlight();
});

this.code_mirror.on('focus', function() { that.unrender(); });
};

/**
Expand All @@ -307,13 +309,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;
};


Expand Down

0 comments on commit b4533ec

Please sign in to comment.