Show More
@@ -197,9 +197,13 b'' | |||||
197 |
|
197 | |||
198 | WidgetManager.prototype._handle_comm_open = function (comm, msg) { |
|
198 | WidgetManager.prototype._handle_comm_open = function (comm, msg) { | |
199 | // Handle when a comm is opened. |
|
199 | // Handle when a comm is opened. | |
|
200 | var that = this; | |||
200 | var model_id = comm.comm_id; |
|
201 | var model_id = comm.comm_id; | |
201 | var widget_type_name = msg.content.target_name; |
|
202 | var widget_type_name = msg.content.target_name; | |
202 | var widget_model = new WidgetManager._model_types[widget_type_name](this, model_id, comm); |
|
203 | var widget_model = new WidgetManager._model_types[widget_type_name](this, model_id, comm); | |
|
204 | widget_model.on('comm:close', function () { | |||
|
205 | delete that._models[model_id]; | |||
|
206 | }); | |||
203 | this._models[model_id] = widget_model; |
|
207 | this._models[model_id] = widget_model; | |
204 | }; |
|
208 | }; | |
205 |
|
209 |
General Comments 0
You need to be logged in to leave comments.
Login now