Fix viewlist to use promises correctly

A viewlist wasn't getting properly populated before.  This also switches the list update to use splice for in-place updates.
Jason Grout 11 years ago
parent 9553f30222
commit efe7098a60

@ -579,8 +579,8 @@ define(["widgets/js/manager",
}
// make a copy of the input array
that._models = new_models.slice();
return Promise.all(added_views, function(added) {
that.views = that.views.slice(0,first_removed).concat(added);
return Promise.all(added_views).then(function(added) {
Array.prototype.splice.apply(that.views, [first_removed, that.views.length].concat(added));
return that.views;
});
});

Loading…
Cancel
Save