The new action manager only destroyed viewmanager widgets instead of
any old widget. It now checks for the widget class.
Also, minor improvement to clear_widgets: vms used to stand for
view_managers, but it can destroy any widget.
var to_destroy = this.widgets;
this.widgets = [];
}
- if (widget instanceof instance.web.ViewManager) {
+ if (widget instanceof instance.web.Widget) {
this.widgets.push(widget);
} else {
this.widgets.push({
});
}
},
- clear_widgets: function(vms) {
- _.each(vms || this.widgets, function (vm) {
- vm.destroy();
- });
- if (!vms) {
+ clear_widgets: function(widgets) {
+ _.invoke(widgets || this.widgets, 'destroy');
+ if (!widgets) {
this.widgets = [];
this.inner_widget = null;
}