##// END OF EJS Templates
Address @carreau 's comments
Jonathan Frederic -
Show More
@@ -86,6 +86,17 define([
86 86 // deactivated, it's popped from the stack. When the stack is empty,
87 87 // the cell's output area is used.
88 88 this.active_output_areas = [];
89 var that = this;
90 Object.defineProperty(this, 'active_output_area', {
91 get: function() {
92 if (that.active_output_areas && that.active_output_areas.length > 0) {
93 return that.active_output_areas[that.active_output_areas.length-1];
94 } else {
95 return that.output_area;
96 }
97 },
98 });
99
89 100 this.last_msg_id = null;
90 101 this.completer = null;
91 102
@@ -98,8 +109,6 define([
98 109
99 110 // Attributes we want to override in this subclass.
100 111 this.cell_type = "code";
101
102 var that = this;
103 112 this.element.focusout(
104 113 function() { that.auto_highlight(); }
105 114 );
@@ -125,17 +134,6 define([
125 134 CodeCell.prototype = Object.create(Cell.prototype);
126 135
127 136 /**
128 * @method get_output_area
129 */
130 CodeCell.prototype.get_output_area = function () {
131 if (this.active_output_areas && this.active_output_areas.length > 0) {
132 return this.active_output_areas[this.active_output_areas.length-1];
133 } else {
134 return this.output_area;
135 }
136 };
137
138 /**
139 137 * @method push_output_area
140 138 */
141 139 CodeCell.prototype.push_output_area = function (output_area) {
@@ -318,7 +316,7 define([
318 316 return;
319 317 }
320 318
321 this.get_output_area().clear_output();
319 this.active_output_area.clear_output();
322 320
323 321 // Clear widget area
324 322 this.widget_subarea.html('');
@@ -358,12 +356,10 define([
358 356 },
359 357 iopub : {
360 358 output : function() {
361 var output_area = that.get_output_area();
362 output_area.handle_output.apply(output_area, arguments);
359 that.active_output_area.handle_output.apply(output_area, arguments);
363 360 },
364 361 clear_output : function() {
365 var output_area = that.get_output_area();
366 output_area.handle_clear_output.apply(output_area, arguments);
362 that.active_output_area.handle_clear_output.apply(output_area, arguments);
367 363 },
368 364 },
369 365 input : $.proxy(this._handle_input_request, this)
@@ -398,7 +394,7 define([
398 394 * @private
399 395 */
400 396 CodeCell.prototype._handle_input_request = function (msg) {
401 this.get_output_area().append_raw_input(msg);
397 this.active_output_area.append_raw_input(msg);
402 398 };
403 399
404 400
@@ -501,7 +497,7 define([
501 497
502 498
503 499 CodeCell.prototype.clear_output = function (wait) {
504 this.get_output_area().clear_output(wait);
500 this.active_output_area.clear_output(wait);
505 501 this.set_input_prompt();
506 502 };
507 503
@@ -5,7 +5,8 define([
5 5 "widgets/js/widget",
6 6 "jquery",
7 7 'notebook/js/outputarea',
8 ], function(widget, $, outputarea){
8 ], function(widget, $, outputarea) {
9 'use strict';
9 10
10 11 var OutputView = widget.DOMWidgetView.extend({
11 12 initialize: function (parameters) {
General Comments 0
You need to be logged in to leave comments. Login now