Adding support for object status

This commit is contained in:
Henry 2015-11-19 15:12:43 -08:00
parent 50d83eaffb
commit 4ea757faa5
2 changed files with 10 additions and 4 deletions

View File

@ -72,8 +72,10 @@ define(
* Enter edit mode.
*/
EditAction.prototype.perform = function () {
if (!this.domainObject.getDomainObject) {
this.navigationService.setNavigation(new EditableDomainObject(this.domainObject, this.$q));
var editableObject;
if (!this.domainObject.hasCapability("editor")) {
editableObject = new EditableDomainObject(this.domainObject, this.$q);
this.navigationService.setNavigation(editableObject);
}
//this.$location.path("/edit");
};

View File

@ -69,7 +69,8 @@ define(
*/
EditableDomainObjectCache.prototype.getEditableObject = function (domainObject) {
var type = domainObject.getCapability('type'),
EditableDomainObject = this.EditableDomainObject;
EditableDomainObject = this.EditableDomainObject,
editableObject;
// Track the top-level domain object; this will have
// some special behavior for its context capability.
@ -86,10 +87,13 @@ define(
}
// Provide an editable form of the object
return new EditableDomainObject(
editableObject = new EditableDomainObject(
domainObject,
this.cache.getCachedModel(domainObject)
);
editableObject.getCapability("status").set('editing', true);
return editableObject;
};
/**