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. * Enter edit mode.
*/ */
EditAction.prototype.perform = function () { EditAction.prototype.perform = function () {
if (!this.domainObject.getDomainObject) { var editableObject;
this.navigationService.setNavigation(new EditableDomainObject(this.domainObject, this.$q)); if (!this.domainObject.hasCapability("editor")) {
editableObject = new EditableDomainObject(this.domainObject, this.$q);
this.navigationService.setNavigation(editableObject);
} }
//this.$location.path("/edit"); //this.$location.path("/edit");
}; };

View File

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