From 719d9ac21787c24522444e826589e03dbb725f93 2014-01-23 00:28:17 From: Jonathan Frederic Date: 2014-01-23 00:28:17 Subject: [PATCH] Added code that removes the views when a model/widget is closed. --- diff --git a/IPython/html/static/notebook/js/widgets/widget.js b/IPython/html/static/notebook/js/widgets/widget.js index 7d8579a..b008045 100644 --- a/IPython/html/static/notebook/js/widgets/widget.js +++ b/IPython/html/static/notebook/js/widgets/widget.js @@ -65,7 +65,9 @@ function(WidgetManager, Underscore, Backbone){ delete this.comm.model; // Delete ref so GC will collect widget model. delete this.comm; delete this.model_id; // Delete id from model so widget manager cleans up. - // TODO: Handle deletion, like this.destroy(), and delete views, etc. + _.each(this.views, function(view, i) { + view.remove(); + }); }, _handle_comm_msg: function (msg) {