From dca820e84561b2f7b4fc2545d1a42c6b4fd26aff Mon Sep 17 00:00:00 2001 From: Grant Nestor Date: Fri, 18 Nov 2016 09:29:29 -0800 Subject: [PATCH] Improve `Notebook.render_cell_output` --- notebook/static/notebook/js/notebook.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/notebook/static/notebook/js/notebook.js b/notebook/static/notebook/js/notebook.js index df365e903..3f9036e8c 100644 --- a/notebook/static/notebook/js/notebook.js +++ b/notebook/static/notebook/js/notebook.js @@ -1647,9 +1647,8 @@ import {ShortcutEditor} from 'notebook/js/shortcuteditor'; Notebook.prototype.render_cell_output = function (code_cell) { var cell_data = code_cell.toJSON(); var cell_index = this.find_cell_index(code_cell); - this.delete_cell(cell_index); - var new_cell = this.insert_cell_at_index(cell_data.cell_type, cell_index); - new_cell.fromJSON(cell_data); + this.clear_output(cell_index); + code_cell.fromJSON(cell_data); }; // Split/merge