mirror of
https://github.com/nasa/openmct.git
synced 2025-06-16 14:18:16 +00:00
fix(overlay plot): legend updates correctly when removing element via remove action (#7531)
* fix: remove duplicate listeners * fix: if no series found, don't splice * test(e2e): update legend a11y and add test
This commit is contained in:
@ -165,7 +165,6 @@ export default {
|
||||
this.registerListeners(this.config);
|
||||
}
|
||||
this.listenTo(this.config.legend, 'change:expandByDefault', this.changeExpandDefault, this);
|
||||
this.initialize();
|
||||
},
|
||||
mounted() {
|
||||
this.loaded = true;
|
||||
@ -182,16 +181,6 @@ export default {
|
||||
this.stopListening();
|
||||
},
|
||||
methods: {
|
||||
initialize() {
|
||||
if (this.domainObject.type === 'telemetry.plot.stacked') {
|
||||
this.objectComposition = this.openmct.composition.get(this.domainObject);
|
||||
this.objectComposition.on('add', this.addTelemetryObject);
|
||||
this.objectComposition.on('remove', this.removeTelemetryObject);
|
||||
this.objectComposition.load();
|
||||
} else {
|
||||
this.registerListeners(this.config);
|
||||
}
|
||||
},
|
||||
changeExpandDefault() {
|
||||
this.isLegendExpanded = this.config.legend.model.expandByDefault;
|
||||
this.legend.set('expanded', this.isLegendExpanded);
|
||||
|
Reference in New Issue
Block a user