From ed4ee44a21d56bd4d5a0c8074f56b505bba6eb35 Mon Sep 17 00:00:00 2001 From: MinRK Date: Sun, 10 Jun 2012 21:26:17 -0700 Subject: [PATCH] add ^M-O for toggling output scroll --- IPython/frontend/html/notebook/static/js/codecell.js | 5 +++++ IPython/frontend/html/notebook/static/js/notebook.js | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/IPython/frontend/html/notebook/static/js/codecell.js b/IPython/frontend/html/notebook/static/js/codecell.js index 275493746..247f2b788 100644 --- a/IPython/frontend/html/notebook/static/js/codecell.js +++ b/IPython/frontend/html/notebook/static/js/codecell.js @@ -214,6 +214,11 @@ var IPython = (function (IPython) { }; + CodeCell.prototype.toggle_output_scroll = function () { + this.output_area.toggle_scroll(); + }; + + CodeCell.prototype.set_input_prompt = function (number) { this.input_prompt_number = number; var ns = number || " "; diff --git a/IPython/frontend/html/notebook/static/js/notebook.js b/IPython/frontend/html/notebook/static/js/notebook.js index 8c65ca975..e86321554 100644 --- a/IPython/frontend/html/notebook/static/js/notebook.js +++ b/IPython/frontend/html/notebook/static/js/notebook.js @@ -191,7 +191,11 @@ var IPython = (function (IPython) { return false; } else if (event.which === 79 && that.control_key_active) { // Toggle output = o - that.toggle_output(); + if (event.shiftKey){ + that.toggle_output_scroll(); + } else { + that.toggle_output(); + } that.control_key_active = false; return false; } else if (event.which === 83 && that.control_key_active) { @@ -865,6 +869,12 @@ var IPython = (function (IPython) { }; + Notebook.prototype.toggle_output_scroll = function (index) { + var i = this.index_or_selected(index); + this.get_cell(i).toggle_output_scroll(); + }; + + Notebook.prototype.collapse_all_output = function () { var ncells = this.ncells(); var cells = this.get_cells();