diff --git a/IPython/html/static/notebook/js/celltoolbar.js b/IPython/html/static/notebook/js/celltoolbar.js
index 89a940511..b2cef8bed 100644
--- a/IPython/html/static/notebook/js/celltoolbar.js
+++ b/IPython/html/static/notebook/js/celltoolbar.js
@@ -276,11 +276,11 @@ var IPython = (function (IPython) {
this.inner_element.append(local_div);
}
- // If there are no controls hide the toolbar.
- if (this.ui_controls_list.length) {
- this.show();
- } else {
+ // If there are no controls or the cell is a rendered TextCell hide the toolbar.
+ if (!this.ui_controls_list.length || (this.cell instanceof IPython.TextCell && this.cell.rendered)) {
this.hide();
+ } else {
+ this.show();
}
};
diff --git a/IPython/html/static/notebook/js/textcell.js b/IPython/html/static/notebook/js/textcell.js
index 3daad4171..10a358ec1 100644
--- a/IPython/html/static/notebook/js/textcell.js
+++ b/IPython/html/static/notebook/js/textcell.js
@@ -138,6 +138,9 @@ var IPython = (function (IPython) {
}
this.refresh();
}
+ if (this.celltoolbar.ui_controls_list.length) {
+ this.celltoolbar.show();
+ }
return cont;
};
@@ -178,6 +181,7 @@ var IPython = (function (IPython) {
*/
TextCell.prototype.set_rendered = function(text) {
this.element.find('div.text_cell_render').html(text);
+ this.celltoolbar.hide();
};