From 7756fd34a9f6d16f1bfb11a90516e6993ea048c3 Mon Sep 17 00:00:00 2001 From: Min RK Date: Wed, 15 Mar 2017 10:49:54 +0100 Subject: [PATCH] restore append-after-render so all output types are handled consistently --- notebook/static/notebook/js/outputarea.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/notebook/static/notebook/js/outputarea.js b/notebook/static/notebook/js/outputarea.js index a6d35d24d..226d72114 100644 --- a/notebook/static/notebook/js/outputarea.js +++ b/notebook/static/notebook/js/outputarea.js @@ -324,10 +324,6 @@ define([ console.log("unrecognized output type: " + json.output_type); this.append_unrecognized(json); } - - if (record_output) { - this.outputs.push(json); - } if (json.output_type === 'display_data') { var that = this; @@ -335,6 +331,10 @@ define([ } else { this.handle_appended(); } + + if (record_output) { + this.outputs.push(json); + } }; OutputArea.prototype.handle_appended = function () { @@ -621,9 +621,7 @@ define([ targets = this._display_id_targets[display_id] = []; } targets.push({ - // output has been appended when this is called, - // so use the index of the last item. - index: this.outputs.length - 1, + index: this.outputs.length, element: element, }); };