[API] Add containment methods

This commit is contained in:
Victor Woeltjen 2016-08-12 09:27:46 -07:00
parent 1147f3aa47
commit 11409ce509
2 changed files with 8 additions and 0 deletions

View File

@ -94,6 +94,10 @@ define([
}
};
CompositionCollection.prototype.canContain = function (domainObject) {
return this.provider.canContain(this.domainObject, domainObject);
};
CompositionCollection.prototype.destroy = function () {
if (this.provider.off) {
this.provider.off(

View File

@ -59,6 +59,10 @@ define([
);
};
DefaultCompositionProvider.prototype.canContain = function (domainObject, child) {
return true;
};
DefaultCompositionProvider.prototype.remove = function (domainObject, child) {
// TODO: this needs to be synchronized via mutation
var index = domainObject.composition.indexOf(child);