mirror of
https://github.com/nasa/openmct.git
synced 2025-03-10 22:43:55 +00:00
[Edit Mode] Added ability to clear all dirty cache
This commit is contained in:
parent
0a5097a945
commit
668c02f278
@ -125,7 +125,7 @@ define(
|
||||
EditorCapability.prototype.cancel = function () {
|
||||
this.editableObject.getCapability("status").set("editing", false);
|
||||
//TODO: Reset the cache as well here.
|
||||
this.cache.markClean(this.editableObject);
|
||||
this.cache.markClean();
|
||||
return resolvePromise(undefined);
|
||||
};
|
||||
|
||||
|
@ -126,7 +126,14 @@ define(
|
||||
* @param {DomainObject} domainObject the domain object
|
||||
*/
|
||||
EditableDomainObjectCache.prototype.markClean = function (domainObject) {
|
||||
delete this.dirtyObjects[domainObject.getId()];
|
||||
var self = this;
|
||||
if (!domainObject) {
|
||||
Object.keys(this.dirtyObjects).forEach(function(key) {
|
||||
delete self.dirtyObjects[key];
|
||||
});
|
||||
} else {
|
||||
delete this.dirtyObjects[domainObject.getId()];
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user