@ -186,9 +186,30 @@ function(widget_manager, underscore, backbone){
// if the view name is not given, it defaults to the model's default view attribute
var child _model = this . comm _manager . comms [ comm _id ] . model ;
var child _view = this . widget _manager . create _view ( child _model , view _name , this . cell ) ;
this . child _views .push ( child _view ) ;
this . child _views [comm _id ] = child _view ;
return child _view ;
} ,
update _child _views : function ( old _list , new _list ) {
// this function takes an old list and new list of comm ids
// views in child_views that correspond to deleted ids are deleted
// views corresponding to added ids are added child_views
// delete old views
_ . each ( _ . difference ( old _list , new _list ) , function ( element , index , list ) {
var view = this . child _views [ element ] ;
delete this . child _views [ element ] ;
view . remove ( ) ;
} , this ) ;
// add new views
_ . each ( _ . difference ( new _list , old _list ) , function ( element , index , list ) {
// this function adds the view to the child_views dictionary
this . child _view ( element ) ;
} , this ) ;
} ,
render : function ( ) {
// render the view. By default, this is only called the first time the view is created