diff --git a/platform/commonUI/edit/src/actions/EditAction.js b/platform/commonUI/edit/src/actions/EditAction.js index 6aa5919ccd..2f935963e2 100644 --- a/platform/commonUI/edit/src/actions/EditAction.js +++ b/platform/commonUI/edit/src/actions/EditAction.js @@ -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"); }; diff --git a/platform/commonUI/edit/src/objects/EditableDomainObjectCache.js b/platform/commonUI/edit/src/objects/EditableDomainObjectCache.js index 88a154d79b..c724c601d8 100644 --- a/platform/commonUI/edit/src/objects/EditableDomainObjectCache.js +++ b/platform/commonUI/edit/src/objects/EditableDomainObjectCache.js @@ -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; }; /**