Review comments

This commit is contained in:
Jonathan Frederic 2014-07-08 11:22:47 -05:00
parent 988fd1b5f9
commit fa39d91446
3 changed files with 7 additions and 7 deletions

View File

@ -304,8 +304,8 @@ function(WidgetManager, _, Backbone){
// TODO: this is hacky, and makes the view depend on this cell attribute and widget manager behavior
// it would be great to have the widget manager add the cell metadata
// to the subview without having to add it here.
var child_view = this.model.widget_manager.create_view(child_model, options || {}, this);
child_view.id = child_view.id || IPython.utils.uuid();
options = $.merge({ parent: this }, options || {});
var child_view = this.model.widget_manager.create_view(child_model, options, this);
// Associate the view id with the model id.
if (this.child_model_views[child_model.id] === undefined) {
@ -318,7 +318,7 @@ function(WidgetManager, _, Backbone){
return child_view;
},
delete_child_view: function(child_model, options) {
pop_child_view: function(child_model) {
// Delete a child view that was previously created using create_child_view.
var view_ids = this.child_model_views[child_model.id];
if (view_ids !== undefined) {

View File

@ -50,7 +50,7 @@ define(["widgets/js/widget"], function(WidgetManager) {
remove_child_model: function(model) {
// Called when a model is removed from the children list.
this.delete_child_view(model).remove();
this.pop_child_view(model).remove();
},
add_child_model: function(model) {
@ -254,7 +254,7 @@ define(["widgets/js/widget"], function(WidgetManager) {
remove_child_model: function(model) {
// Called when a child is removed from children list.
this.delete_child_view(model).remove();
this.pop_child_view(model).remove();
},
add_child_model: function(model) {

View File

@ -92,7 +92,7 @@ define(["widgets/js/widget"], function(WidgetManager){
this.containers.splice(accordion_group.container_index, 1);
delete this.model_containers[model.id];
accordion_group.remove();
this.delete_child_view(model);
this.pop_child_view(model);
},
add_child_model: function(model) {
@ -190,7 +190,7 @@ define(["widgets/js/widget"], function(WidgetManager){
remove_child_model: function(model) {
// Called when a child is removed from children list.
var view = this.delete_child_view(model);
var view = this.pop_child_view(model);
this.containers.splice(view.parent_tab.tab_text_index, 1);
view.parent_tab.remove();
view.parent_container.remove();