Show More
@@ -256,27 +256,10 | |||
|
256 | 256 | }; |
|
257 | 257 | |
|
258 | 258 | |
|
259 | WidgetManager.prototype.on_create_widget = function (callback) { | |
|
260 | this._create_widget_callback = callback; | |
|
261 | }; | |
|
262 | ||
|
263 | ||
|
264 | WidgetManager.prototype._handle_create_widget = function (widget_model) { | |
|
265 | if (this._create_widget_callback) { | |
|
266 | try { | |
|
267 | this._create_widget_callback(widget_model); | |
|
268 | } catch (e) { | |
|
269 | console.log("Exception in WidgetManager callback", e, widget_model); | |
|
270 | } | |
|
271 | } | |
|
272 | }; | |
|
273 | ||
|
274 | ||
|
275 | 259 | WidgetManager.prototype._handle_comm_open = function (comm, msg) { |
|
276 | 260 | var widget_type_name = msg.content.target_name; |
|
277 | 261 | var widget_model = new this._model_types[widget_type_name](this, comm.comm_id, comm); |
|
278 | 262 | this._models[comm.comm_id] = widget_model; // comm_id == model_id |
|
279 | this._handle_create_widget(widget_model); | |
|
280 | 263 | }; |
|
281 | 264 | |
|
282 | 265 | //-------------------------------------------------------------------- |
General Comments 0
You need to be logged in to leave comments.
Login now