Show More
@@ -5,8 +5,9 b' define(["widgets/js/manager",' | |||||
5 | "underscore", |
|
5 | "underscore", | |
6 |
"backbone", |
|
6 | "backbone", | |
7 |
"jquery", |
|
7 | "jquery", | |
|
8 | "base/js/utils", | |||
8 | "base/js/namespace", |
|
9 | "base/js/namespace", | |
9 | ], function(widgetmanager, _, Backbone, $, IPython){ |
|
10 | ], function(widgetmanager, _, Backbone, $, utils, IPython){ | |
10 |
|
11 | |||
11 | var WidgetModel = Backbone.Model.extend({ |
|
12 | var WidgetModel = Backbone.Model.extend({ | |
12 | constructor: function (widget_manager, model_id, comm) { |
|
13 | constructor: function (widget_manager, model_id, comm) { | |
@@ -259,7 +260,7 b' define(["widgets/js/manager",' | |||||
259 | _.each(value, function(sub_value, key) { |
|
260 | _.each(value, function(sub_value, key) { | |
260 | unpacked[key] = that._unpack_models(sub_value) |
|
261 | unpacked[key] = that._unpack_models(sub_value) | |
261 | }); |
|
262 | }); | |
262 | return util.resolve_dict(unpacked); |
|
263 | return utils.resolve_dict(unpacked); | |
263 | } else if (typeof value === 'string' && value.slice(0,10) === "IPY_MODEL_") { |
|
264 | } else if (typeof value === 'string' && value.slice(0,10) === "IPY_MODEL_") { | |
264 | // get_model returns a promise already |
|
265 | // get_model returns a promise already | |
265 | return this.widget_manager.get_model(value.slice(10, value.length)); |
|
266 | return this.widget_manager.get_model(value.slice(10, value.length)); | |
@@ -292,7 +293,7 b' define(["widgets/js/manager",' | |||||
292 | this.options = parameters.options; |
|
293 | this.options = parameters.options; | |
293 | this.child_model_views = {}; |
|
294 | this.child_model_views = {}; | |
294 | this.child_views = {}; |
|
295 | this.child_views = {}; | |
295 |
this.id = this.id || |
|
296 | this.id = this.id || utils.uuid(); | |
296 | this.model.views[this.id] = this; |
|
297 | this.model.views[this.id] = this; | |
297 | this.on('displayed', function() { |
|
298 | this.on('displayed', function() { | |
298 | this.is_displayed = true; |
|
299 | this.is_displayed = true; |
General Comments 0
You need to be logged in to leave comments.
Login now