Call the code cell’s clear_output so a cell event is triggered.

Thanks to @gnestor for this, from PR #2394.
pull/2411/head
Jason Grout 9 years ago
parent 76b77a0b09
commit 8e822e999f

@ -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();
};

@ -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;

Loading…
Cancel
Save