From 8e822e999f24fdaf48e979bf32ef28854e309ebe Mon Sep 17 00:00:00 2001 From: Jason Grout Date: Thu, 13 Apr 2017 16:20:28 -0400 Subject: [PATCH] =?UTF-8?q?Call=20the=20code=20cell=E2=80=99s=20clear=5Fou?= =?UTF-8?q?tput=20so=20a=20cell=20event=20is=20triggered.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to @gnestor for this, from PR #2394. --- notebook/static/notebook/js/codecell.js | 8 ++++---- notebook/static/notebook/js/outputarea.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/notebook/static/notebook/js/codecell.js b/notebook/static/notebook/js/codecell.js index 34c48ea14..d29e02fd0 100644 --- a/notebook/static/notebook/js/codecell.js +++ b/notebook/static/notebook/js/codecell.js @@ -313,7 +313,7 @@ define([ stop_on_error = true; } - this.output_area.clear_output(false, true); + this.clear_output(false, true); var old_msg_id = this.last_msg_id; if (old_msg_id) { this.kernel.clear_callbacks_for_msg(old_msg_id); @@ -509,10 +509,10 @@ define([ }; - CodeCell.prototype.clear_output = function (wait) { - this.output_area.clear_output(wait); - this.set_input_prompt(); + CodeCell.prototype.clear_output = function (wait, ignore_queue) { this.events.trigger('clear_output.CodeCell', {cell: this}); + this.output_area.clear_output(wait, ignore_queue); + this.set_input_prompt(); }; diff --git a/notebook/static/notebook/js/outputarea.js b/notebook/static/notebook/js/outputarea.js index 6ca9eefc2..71c7b5726 100644 --- a/notebook/static/notebook/js/outputarea.js +++ b/notebook/static/notebook/js/outputarea.js @@ -942,7 +942,7 @@ define([ }; - OutputArea.prototype.clear_output = function(wait, ignore_que) { + OutputArea.prototype.clear_output = function(wait, ignore_clear_queue) { if (wait) { // If a clear is queued, clear before adding another to the queue. @@ -955,7 +955,7 @@ define([ // Fix the output div's height if the clear_output is waiting for // new output (it is being used in an animation). - if (!ignore_que && this.clear_queued) { + if (!ignore_clear_queue && this.clear_queued) { var height = this.element.height(); this.element.height(height); this.clear_queued = false;