From 07e2df5b85d031f19ad4e3e7071347d513ff0f72 2014-01-22 00:29:59 From: Jonathan Frederic Date: 2014-01-22 00:29:59 Subject: [PATCH] - remove second line in create_child_view - add undefined check in delete_child_view --- diff --git a/IPython/html/static/notebook/js/widgets/widget.js b/IPython/html/static/notebook/js/widgets/widget.js index 9a23283..a9d5c37 100644 --- a/IPython/html/static/notebook/js/widgets/widget.js +++ b/IPython/html/static/notebook/js/widgets/widget.js @@ -257,9 +257,7 @@ function(WidgetManager, Underscore, 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. - options = options || {}; - options.cell = this.options.cell; - var child_view = this.model.widget_manager.create_view(child_model, options); + var child_view = this.model.widget_manager.create_view(child_model, options || {}); this.child_views[child_model.id] = child_view; return child_view; }, @@ -267,8 +265,10 @@ function(WidgetManager, Underscore, Backbone){ delete_child_view: function(child_model, options) { // Delete a child view that was previously created using create_child_view. var view = this.child_views[child_model.id]; - delete this.child_views[child_model.id]; - view.remove(); + if (view !== undefined) { + delete this.child_views[child_model.id]; + view.remove(); + } }, do_diff: function(old_list, new_list, removed_callback, added_callback) {