Further cleanup for celltoolbars.

This commit is contained in:
Brian Granger 2013-01-17 15:24:39 -08:00
parent a27a0f4980
commit b6c7d7965c
3 changed files with 15 additions and 13 deletions

View File

@ -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;
}

View File

@ -37,10 +37,12 @@ var IPython = (function (IPython) {
this.inner_element = $('<div/>');
var ctb_element = $('<div/>').addClass('celltoolbar')
.append(this.inner_element);
this.element = $('<div/>').addClass('ctb_wrapper hbox');
ctb_element.addClass('box-flex1');
var ctb_area = $('<div/>').addClass('ctb_area hbox');
var ctb_prompt = $('<div/>').addClass('ctb_prompt prompt');
this.element.append(ctb_prompt).append(ctb_element);
ctb_area.append(ctb_prompt).append(ctb_element);
this.element = $('<div/>').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');
}

View File

@ -45,8 +45,10 @@ var IPython = (function (IPython) {
IPython.Cell.prototype.create_element.apply(this, arguments);
var cell = $("<div>").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 = $('<div/>').addClass('text_cell_input border-box-sizing');
this.code_mirror = CodeMirror(input_area.get(0), {
indentUnit : 4,