Show More
@@ -304,8 +304,8 function(WidgetManager, _, Backbone){ | |||||
304 | // TODO: this is hacky, and makes the view depend on this cell attribute and widget manager behavior |
|
304 | // TODO: this is hacky, and makes the view depend on this cell attribute and widget manager behavior | |
305 | // it would be great to have the widget manager add the cell metadata |
|
305 | // it would be great to have the widget manager add the cell metadata | |
306 | // to the subview without having to add it here. |
|
306 | // to the subview without having to add it here. | |
307 | var child_view = this.model.widget_manager.create_view(child_model, options || {}, this); |
|
307 | options = $.merge({ parent: this }, options || {}); | |
308 | child_view.id = child_view.id || IPython.utils.uuid(); |
|
308 | var child_view = this.model.widget_manager.create_view(child_model, options, this); | |
309 |
|
309 | |||
310 | // Associate the view id with the model id. |
|
310 | // Associate the view id with the model id. | |
311 | if (this.child_model_views[child_model.id] === undefined) { |
|
311 | if (this.child_model_views[child_model.id] === undefined) { | |
@@ -318,7 +318,7 function(WidgetManager, _, Backbone){ | |||||
318 | return child_view; |
|
318 | return child_view; | |
319 | }, |
|
319 | }, | |
320 |
|
320 | |||
321 |
|
|
321 | pop_child_view: function(child_model) { | |
322 | // Delete a child view that was previously created using create_child_view. |
|
322 | // Delete a child view that was previously created using create_child_view. | |
323 | var view_ids = this.child_model_views[child_model.id]; |
|
323 | var view_ids = this.child_model_views[child_model.id]; | |
324 | if (view_ids !== undefined) { |
|
324 | if (view_ids !== undefined) { |
@@ -50,7 +50,7 define(["widgets/js/widget"], function(WidgetManager) { | |||||
50 |
|
50 | |||
51 | remove_child_model: function(model) { |
|
51 | remove_child_model: function(model) { | |
52 | // Called when a model is removed from the children list. |
|
52 | // Called when a model is removed from the children list. | |
53 |
this. |
|
53 | this.pop_child_view(model).remove(); | |
54 | }, |
|
54 | }, | |
55 |
|
55 | |||
56 | add_child_model: function(model) { |
|
56 | add_child_model: function(model) { | |
@@ -254,7 +254,7 define(["widgets/js/widget"], function(WidgetManager) { | |||||
254 |
|
254 | |||
255 | remove_child_model: function(model) { |
|
255 | remove_child_model: function(model) { | |
256 | // Called when a child is removed from children list. |
|
256 | // Called when a child is removed from children list. | |
257 |
this. |
|
257 | this.pop_child_view(model).remove(); | |
258 | }, |
|
258 | }, | |
259 |
|
259 | |||
260 | add_child_model: function(model) { |
|
260 | add_child_model: function(model) { |
@@ -92,7 +92,7 define(["widgets/js/widget"], function(WidgetManager){ | |||||
92 | this.containers.splice(accordion_group.container_index, 1); |
|
92 | this.containers.splice(accordion_group.container_index, 1); | |
93 | delete this.model_containers[model.id]; |
|
93 | delete this.model_containers[model.id]; | |
94 | accordion_group.remove(); |
|
94 | accordion_group.remove(); | |
95 |
this. |
|
95 | this.pop_child_view(model); | |
96 | }, |
|
96 | }, | |
97 |
|
97 | |||
98 | add_child_model: function(model) { |
|
98 | add_child_model: function(model) { | |
@@ -190,7 +190,7 define(["widgets/js/widget"], function(WidgetManager){ | |||||
190 |
|
190 | |||
191 | remove_child_model: function(model) { |
|
191 | remove_child_model: function(model) { | |
192 | // Called when a child is removed from children list. |
|
192 | // Called when a child is removed from children list. | |
193 |
var view = this. |
|
193 | var view = this.pop_child_view(model); | |
194 | this.containers.splice(view.parent_tab.tab_text_index, 1); |
|
194 | this.containers.splice(view.parent_tab.tab_text_index, 1); | |
195 | view.parent_tab.remove(); |
|
195 | view.parent_tab.remove(); | |
196 | view.parent_container.remove(); |
|
196 | view.parent_container.remove(); |
General Comments 0
You need to be logged in to leave comments.
Login now