From a864c172d5954659bb6f91e7c8c7e652475058cf Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 20 Nov 2015 10:07:58 -0800 Subject: [PATCH] [Edit Mode Prototype] #278 Added visual indication of edit --- .../commonUI/edit/src/objects/EditableDomainObject.js | 8 ++++++-- .../edit/src/objects/EditableDomainObjectCache.js | 9 --------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/platform/commonUI/edit/src/objects/EditableDomainObject.js b/platform/commonUI/edit/src/objects/EditableDomainObject.js index 8c15b2efed..8ca905c9cd 100644 --- a/platform/commonUI/edit/src/objects/EditableDomainObject.js +++ b/platform/commonUI/edit/src/objects/EditableDomainObject.js @@ -79,7 +79,8 @@ define( // are not shown in different sections of the same Edit // UI, which might thereby fall out of sync. var cache, - originalObject = domainObject; + originalObject = domainObject, + cachedObject; // Constructor for EditableDomainObject, which adheres // to the same shared cache. @@ -116,7 +117,10 @@ define( } cache = new EditableDomainObjectCache(EditableDomainObjectImpl, $q); - return cache.getEditableObject(domainObject); + cachedObject = cache.getEditableObject(domainObject); + cachedObject.getCapability('status').set('editing', true); + + return cachedObject; } return EditableDomainObject; diff --git a/platform/commonUI/edit/src/objects/EditableDomainObjectCache.js b/platform/commonUI/edit/src/objects/EditableDomainObjectCache.js index 2a9d2d2643..a468b5283c 100644 --- a/platform/commonUI/edit/src/objects/EditableDomainObjectCache.js +++ b/platform/commonUI/edit/src/objects/EditableDomainObjectCache.js @@ -92,15 +92,6 @@ define( domainObject, this.cache.getCachedModel(domainObject) ); - editableObject.getCapability("status").set('editing', true); - if (!this.isRoot(domainObject)){ - statusListener = this.root.getCapability("status").listen(function(statuses){ - if (statuses.indexOf("editing") < 0 ){ - editableObject.getCapability("status").set("editing", false); - statusListener(); - } - }); - } return editableObject; };