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