[Edit Mode Prototype] #278 Added visual indication of edit

This commit is contained in:
Henry 2015-11-20 10:07:58 -08:00
parent 10a44c026c
commit a864c172d5
2 changed files with 6 additions and 11 deletions

View File

@ -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;

View File

@ -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;
};