Permalink
Browse files

Cell collapse/expand is not called "Toggle".

  • Loading branch information...
1 parent 68889f9 commit 8013d527b14050b5c1523648497cf1e9568882b9 @ellisonbg ellisonbg committed Aug 19, 2011
View
8 IPython/frontend/html/notebook/static/js/codecell.js
@@ -352,6 +352,14 @@ var IPython = (function (IPython) {
};
+ CodeCell.prototype.toggle_output = function () {
+ if (this.collapsed) {
+ this.expand();
+ } else {
+ this.collapse();
+ };
+ };
+
CodeCell.prototype.set_input_prompt = function (number) {
var n = number || ' ';
this.input_prompt_number = n
View
7 IPython/frontend/html/notebook/static/js/notebook.js
@@ -480,6 +480,13 @@ var IPython = (function (IPython) {
};
+ Notebook.prototype.toggle_output = function (index) {
+ var i = this.index_or_selected(index);
+ this.cells()[i].toggle_output();
+ this.dirty = true;
+ };
+
+
Notebook.prototype.set_autoindent = function (state) {
var cells = this.cells();
len = cells.length;
View
12 IPython/frontend/html/notebook/static/js/panelsection.js
@@ -130,18 +130,15 @@ var IPython = (function (IPython) {
this.content.find('#insert').buttonset();
this.content.find('#move').buttonset();
this.content.find('#cell_type').buttonset();
- this.content.find('#toggle_output').buttonset();
+ this.content.find('#cell_output').buttonset();
this.content.find('#run_cells').buttonset();
};
CellSection.prototype.bind_events = function () {
PanelSection.prototype.bind_events.apply(this);
- this.content.find('#collapse_cell').click(function () {
- IPython.notebook.collapse();
- });
- this.content.find('#expand_cell').click(function () {
- IPython.notebook.expand();
+ this.content.find('#toggle_output').click(function () {
+ IPython.notebook.toggle_output();
});
this.content.find('#clear_all_output').click(function () {
IPython.notebook.clear_all_output();
@@ -164,9 +161,6 @@ var IPython = (function (IPython) {
this.content.find('#to_code').click(function () {
IPython.notebook.to_code();
});
-// this.content.find('#to_html').click(function () {
-// IPython.notebook.to_html();
-// });
this.content.find('#to_markdown').click(function () {
IPython.notebook.to_markdown();
});
View
5 IPython/frontend/html/notebook/templates/notebook.html
@@ -95,9 +95,8 @@ <h3 class="section_header">Cell</h3>
<span class="button_label">Format</span>
</div>
<div class="section_row">
- <span id="toggle_output" class="section_row_buttons">
- <button id="collapse_cell">Collapse</button>
- <button id="expand_cell">Expand</button>
+ <span id="cell_output" class="section_row_buttons">
+ <button id="toggle_output">Toggle</button>
<button id="clear_all_output">ClearAll</button>
</span>
<span class="button_label">Output</span>

0 comments on commit 8013d52

Please sign in to comment.