[New Edit Mode] Added AddAction, modified EditableDomainObject to properly wrap inherited functions, added new EditableInstantiationCapability

This commit is contained in:
Henry
2016-01-20 18:49:39 -08:00
parent fcae3fd7a9
commit c65096f166
13 changed files with 512 additions and 71 deletions

View File

@@ -81,7 +81,8 @@ define(
var domainObject = this.domainObject,
editableObject = this.editableObject,
self = this,
cache = this.cache;
cache = this.cache,
returnPromise;
// Update the underlying, "real" domain object's model
// with changes made to the copy used for editing.
@@ -99,14 +100,18 @@ define(
editableObject.getCapability("status").set("editing", false);
if (nonrecursive) {
return resolvePromise(doMutate())
returnPromise = resolvePromise(doMutate())
.then(doPersist)
.then(function(){
self.cancel();
});
} else {
return resolvePromise(cache.saveAll());
returnPromise = resolvePromise(cache.saveAll());
}
//Return the original (non-editable) object
return returnPromise.then(function() {
return domainObject;
})
};
/**