mirror of
https://github.com/nasa/openmct.git
synced 2025-02-21 17:57:04 +00:00
Merge pull request #2137 from nasa/prevent-plot-accidental-remove
[Plot] Update formDomainObject on mutate
This commit is contained in:
commit
9582fb2b06
@ -83,6 +83,7 @@ define([
|
||||
|
||||
this.listenTo(this, 'change:xKey', this.onXKeyChange, this);
|
||||
this.listenTo(this, 'change:yKey', this.onYKeyChange, this);
|
||||
this.persistedConfig = options.persistedConfig;
|
||||
|
||||
Model.apply(this, arguments);
|
||||
this.onXKeyChange(this.get('xKey'));
|
||||
@ -176,8 +177,7 @@ define([
|
||||
return;
|
||||
}
|
||||
var valueMetadata = this.metadata.value(newKey);
|
||||
var persistedConfig = this.get('persistedConfiguration');
|
||||
if (!persistedConfig || !persistedConfig.interpolate) {
|
||||
if (!this.persistedConfig || !this.persistedConfig.interpolate) {
|
||||
if (valueMetadata.format === 'enum') {
|
||||
this.set('interpolate', 'stepAfter');
|
||||
} else {
|
||||
|
@ -54,7 +54,7 @@ define([
|
||||
domainObject.configuration.series.forEach(function (seriesConfig) {
|
||||
var series = this.byIdentifier(seriesConfig.identifier);
|
||||
if (series) {
|
||||
series.set('persistedConfiguration', seriesConfig);
|
||||
series.persistedConfig = seriesConfig;
|
||||
}
|
||||
}, this);
|
||||
},
|
||||
@ -90,7 +90,9 @@ define([
|
||||
model: seriesConfig,
|
||||
domainObject: domainObject,
|
||||
collection: this,
|
||||
openmct: this.openmct
|
||||
openmct: this.openmct,
|
||||
persistedConfig: this.plot
|
||||
.getPersistedSeriesConfig(domainObject.identifier)
|
||||
}));
|
||||
},
|
||||
removeTelemetryObject: function (identifier) {
|
||||
|
@ -45,6 +45,7 @@ define([
|
||||
|
||||
PlotOptionsController.prototype.updateDomainObject = function (domainObject) {
|
||||
this.domainObject = domainObject;
|
||||
this.$scope.formDomainObject = domainObject;
|
||||
};
|
||||
|
||||
PlotOptionsController.prototype.destroy = function () {
|
||||
@ -63,8 +64,7 @@ define([
|
||||
this.config = this.$scope.config = config;
|
||||
this.$scope.plotSeries = [];
|
||||
|
||||
this.domainObject = this.config.get('domainObject');
|
||||
this.$scope.formDomainObject = this.domainObject;
|
||||
this.updateDomainObject(this.config.get('domainObject'));
|
||||
this.unlisten = this.openmct.objects.observe(this.domainObject, '*', this.updateDomainObject.bind(this));
|
||||
|
||||
this.listenTo(this.$scope, '$destroy', this.destroy, this);
|
||||
|
Loading…
x
Reference in New Issue
Block a user