Show More
@@ -435,7 +435,7 b' define(["components/underscore/underscore-min",' | |||||
435 |
|
435 | |||
436 | // Register already register widget model types with the comm manager. |
|
436 | // Register already register widget model types with the comm manager. | |
437 | for (var widget_model_name in this.widget_model_types) { |
|
437 | for (var widget_model_name in this.widget_model_types) { | |
438 | this.comm_manager.register_target(widget_model_name, $.proxy(this.handle_com_open, this)); |
|
438 | this.comm_manager.register_target(widget_model_name, $.proxy(this._handle_com_open, this)); | |
439 | } |
|
439 | } | |
440 | } |
|
440 | } | |
441 |
|
441 | |||
@@ -444,7 +444,7 b' define(["components/underscore/underscore-min",' | |||||
444 | // Register the widget with the comm manager. Make sure to pass this object's context |
|
444 | // Register the widget with the comm manager. Make sure to pass this object's context | |
445 | // in so `this` works in the call back. |
|
445 | // in so `this` works in the call back. | |
446 | if (this.comm_manager!=null) { |
|
446 | if (this.comm_manager!=null) { | |
447 | this.comm_manager.register_target(widget_model_name, $.proxy(this.handle_com_open, this)); |
|
447 | this.comm_manager.register_target(widget_model_name, $.proxy(this._handle_com_open, this)); | |
448 | } |
|
448 | } | |
449 | this.widget_model_types[widget_model_name] = widget_model_type; |
|
449 | this.widget_model_types[widget_model_name] = widget_model_type; | |
450 | } |
|
450 | } | |
@@ -455,12 +455,6 b' define(["components/underscore/underscore-min",' | |||||
455 | } |
|
455 | } | |
456 |
|
456 | |||
457 |
|
457 | |||
458 | WidgetManager.prototype.handle_com_open = function (comm, msg) { |
|
|||
459 | var widget_type_name = msg.content.target_name; |
|
|||
460 | var widget_model = new this.widget_model_types[widget_type_name](this.comm_manager, comm, this); |
|
|||
461 | } |
|
|||
462 |
|
||||
463 |
|
||||
464 | WidgetManager.prototype.get_msg_cell = function (msg_id) { |
|
458 | WidgetManager.prototype.get_msg_cell = function (msg_id) { | |
465 | if (IPython.notebook != undefined && IPython.notebook != null) { |
|
459 | if (IPython.notebook != undefined && IPython.notebook != null) { | |
466 | return IPython.notebook.get_msg_cell(msg_id); |
|
460 | return IPython.notebook.get_msg_cell(msg_id); | |
@@ -468,6 +462,12 b' define(["components/underscore/underscore-min",' | |||||
468 | } |
|
462 | } | |
469 |
|
463 | |||
470 |
|
464 | |||
|
465 | WidgetManager.prototype._handle_com_open = function (comm, msg) { | |||
|
466 | var widget_type_name = msg.content.target_name; | |||
|
467 | var widget_model = new this.widget_model_types[widget_type_name](this.comm_manager, comm, this); | |||
|
468 | } | |||
|
469 | ||||
|
470 | ||||
471 | //-------------------------------------------------------------------- |
|
471 | //-------------------------------------------------------------------- | |
472 | // Init code |
|
472 | // Init code | |
473 | //-------------------------------------------------------------------- |
|
473 | //-------------------------------------------------------------------- |
General Comments 0
You need to be logged in to leave comments.
Login now