##// END OF EJS Templates
Cleaned up _make_callbacks method of widget model class
Jonathan Frederic -
Show More
@@ -355,12 +355,23 b' define(["components/underscore/underscore-min",'
355 // Build a callback dict.
355 // Build a callback dict.
356 _make_callbacks: function (cell) {
356 _make_callbacks: function (cell) {
357 var callbacks = {};
357 var callbacks = {};
358 if (cell != null && cell.output_area != undefined && cell.output_area != null) {
358 if (cell != null) {
359
360 // Try to get output handlers
361 var handle_output = null;
362 var handle_clear_output = null;
363 if (cell.output_area != undefined && cell.output_area != null) {
364 handle_output = $.proxy(cell.output_area.handle_output, cell.output_area);
365 handle_clear_output = $.proxy(cell.output_area.handle_clear_output, cell.output_area);
366 }
367
368 // Create callback dict usign what is known
359 var that = this;
369 var that = this;
360 callbacks = {
370 callbacks = {
361 iopub : {
371 iopub : {
362 output : $.proxy(cell.output_area.handle_output, cell.output_area),
372 output : handle_output,
363 clear_output : $.proxy(cell.output_area.handle_clear_output, cell.output_area),
373 clear_output : handle_clear_output,
374
364 status : function(msg){
375 status : function(msg){
365 that._handle_status(cell, msg);
376 that._handle_status(cell, msg);
366 },
377 },
@@ -369,12 +380,7 b' define(["components/underscore/underscore-min",'
369 // Allows us to get the cell for a message so we know
380 // Allows us to get the cell for a message so we know
370 // where to add widgets if the code requires it.
381 // where to add widgets if the code requires it.
371 get_cell : function() {
382 get_cell : function() {
372 if (that.last_modified_view != undefined &&
383 return cell;
373 that.last_modified_view.cell != undefined) {
374 return that.last_modified_view.cell;
375 } else {
376 return null
377 }
378 },
384 },
379 },
385 },
380 };
386 };
General Comments 0
You need to be logged in to leave comments. Login now