mirror of
https://github.com/nasa/openmct.git
synced 2025-06-20 08:03:49 +00:00
[Plot] Update formDomainObject on mutate
When a new series is added to a plot, a plot series form controller is instantiated and passed in a domain object via scope that it will mutate upon changes. If a mutation results in a composition add, then the plot series form controller needs to get a version of the domain object with the updated composition array, which it was not previously doing. This fixes #2120.
This commit is contained in:
@ -45,6 +45,7 @@ define([
|
|||||||
|
|
||||||
PlotOptionsController.prototype.updateDomainObject = function (domainObject) {
|
PlotOptionsController.prototype.updateDomainObject = function (domainObject) {
|
||||||
this.domainObject = domainObject;
|
this.domainObject = domainObject;
|
||||||
|
this.$scope.formDomainObject = domainObject;
|
||||||
};
|
};
|
||||||
|
|
||||||
PlotOptionsController.prototype.destroy = function () {
|
PlotOptionsController.prototype.destroy = function () {
|
||||||
@ -63,8 +64,7 @@ define([
|
|||||||
this.config = this.$scope.config = config;
|
this.config = this.$scope.config = config;
|
||||||
this.$scope.plotSeries = [];
|
this.$scope.plotSeries = [];
|
||||||
|
|
||||||
this.domainObject = this.config.get('domainObject');
|
this.updateDomainObject(this.config.get('domainObject'));
|
||||||
this.$scope.formDomainObject = this.domainObject;
|
|
||||||
this.unlisten = this.openmct.objects.observe(this.domainObject, '*', this.updateDomainObject.bind(this));
|
this.unlisten = this.openmct.objects.observe(this.domainObject, '*', this.updateDomainObject.bind(this));
|
||||||
|
|
||||||
this.listenTo(this.$scope, '$destroy', this.destroy, this);
|
this.listenTo(this.$scope, '$destroy', this.destroy, this);
|
||||||
|
Reference in New Issue
Block a user