From b01bda726e4068618ad059ec0f85cb848f610f78 2013-01-17 23:26:08 From: Brian Granger Date: 2013-01-17 23:26:08 Subject: [PATCH] Further cleanup for celltoolbars. --- diff --git a/IPython/frontend/html/notebook/static/css/celltoolbar.css b/IPython/frontend/html/notebook/static/css/celltoolbar.css index 7153672..e5cf0a1 100644 --- a/IPython/frontend/html/notebook/static/css/celltoolbar.css +++ b/IPython/frontend/html/notebook/static/css/celltoolbar.css @@ -23,27 +23,25 @@ display: block; } -.ctb_wrapper{ +.ctb_hideshow { display: none; } -.toolbaron .ctb_wrapper{ +.ctb_show.ctb_hideshow { display: block; - display: -webkit-box; } -.toolbaron .ctb_wrapper + div > div.input_area, -.toolbaron .ctb_wrapper + div.text_cell_input{ +.ctb_show .ctb_hideshow + div > div.input_area, +.ctb_show .ctb_hideshow + div.text_cell_input { border-top-right-radius: 0px; border-top-left-radius: 0px; } -.toolbaron > .celltoolbar { +.ctb_show > .celltoolbar { border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; } - .button_container { float: right; } diff --git a/IPython/frontend/html/notebook/static/js/celltoolbar.js b/IPython/frontend/html/notebook/static/js/celltoolbar.js index 82cb18f..8a507a4 100644 --- a/IPython/frontend/html/notebook/static/js/celltoolbar.js +++ b/IPython/frontend/html/notebook/static/js/celltoolbar.js @@ -37,10 +37,12 @@ var IPython = (function (IPython) { this.inner_element = $('
'); var ctb_element = $('
').addClass('celltoolbar') .append(this.inner_element); - this.element = $('
').addClass('ctb_wrapper hbox'); ctb_element.addClass('box-flex1'); + var ctb_area = $('
').addClass('ctb_area hbox'); var ctb_prompt = $('
').addClass('ctb_prompt prompt'); - this.element.append(ctb_prompt).append(ctb_element); + ctb_area.append(ctb_prompt).append(ctb_element); + this.element = $('
').addClass('ctb_hideshow') + .append(ctb_area); }; @@ -62,21 +64,21 @@ var IPython = (function (IPython) { CellToolbar.global_hide = function () { - $('body').removeClass('toolbaron'); + $('body').removeClass('ctb_show'); } CellToolbar.global_show = function () { - $('body').addClass('toolbaron'); + $('body').addClass('ctb_show'); } CellToolbar.prototype.hide = function () { - this.element.removeClass('toolbaron'); + this.element.removeClass('ctb_show'); } CellToolbar.prototype.show = function () { - this.element.addClass('toolbaron'); + this.element.addClass('ctb_show'); } diff --git a/IPython/frontend/html/notebook/static/js/textcell.js b/IPython/frontend/html/notebook/static/js/textcell.js index e869b81..fdae47f 100644 --- a/IPython/frontend/html/notebook/static/js/textcell.js +++ b/IPython/frontend/html/notebook/static/js/textcell.js @@ -45,8 +45,10 @@ var IPython = (function (IPython) { IPython.Cell.prototype.create_element.apply(this, arguments); var cell = $("
").addClass('cell text_cell border-box-sizing vbox'); cell.attr('tabindex','2'); + this.celltoolbar = new IPython.CellToolbar(this); cell.append(this.celltoolbar.element); + var input_area = $('
').addClass('text_cell_input border-box-sizing'); this.code_mirror = CodeMirror(input_area.get(0), { indentUnit : 4,